From d829c4820adbe7a7634f1c1d825d0d206512e6e7 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Fri, 22 Dec 2006 20:16:03 +0000 Subject: Merged changes from branches/wrappers since r177. Summary of main changes: + Added -o/--output and -d/--debug options to pandoc. + Modified pandoc to behave differently depending on the name of the program. For example, if the program name is 'html2latex', the default reader will be html and the default writer latex. + Removed most of the old wrappers, replacing them with symlinks to pandoc. + Rewrote markdown2pdf and created a new wrapper web2markdown, with the functionality of the old html2markdown script. These new scripts exploit pandoc's -d option to avoid having to do complex command-line parsing. + Revised man pages and documentation appropriately. git-svn-id: https://pandoc.googlecode.com/svn/trunk@279 788f1e2b-df1e-0410-8736-df70ead52e1b --- Makefile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index aa3f63583..315bc9e45 100644 --- a/Makefile +++ b/Makefile @@ -23,15 +23,16 @@ EXECSBASE := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in) #------------------------------------------------------------------------------- # Install targets #------------------------------------------------------------------------------- +WRAPPERS := web2markdown markdown2pdf +SYMLINKS := markdown2html markdown2latex markdown2s5 markdown2rst \ + markdown2rtf html2markdown latex2markdown rst2markdown +PROGS := $(EXECS) $(WRAPPERS) # Add .exe extensions if we're running Windows/Cygwin. EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | \ sed -ne 's/^cygwin.*$$/\.exe/p') EXECS := $(addsuffix $(EXTENSION),$(EXECSBASE)) # First entry in Cabal's executable stanza is the main executable. MAIN := $(firstword $(EXECS)) -WRAPPERS := html2markdown latex2markdown markdown2html \ - markdown2latex markdown2pdf -PROGS := $(EXECS) $(WRAPPERS) DOCS := README.html README BUGS #------------------------------------------------------------------------------- @@ -92,6 +93,12 @@ all: build-program templates: $(SRCDIR)/templates $(MAKE) -C $(SRCDIR)/templates +.PHONY: symlinks +cleanup_files+=$(SYMLINKS) +symlinks: $(SYMLINKS) +$(SYMLINKS): $(MAIN) + ln -sf ./$(MAIN) $@ + define generate-shell-script echo "Generating $@..."; \ awk ' \ @@ -131,7 +138,7 @@ build: configure $(BUILDCMD) build .PHONY: build-exec -build-exec: $(PROGS) +build-exec: $(PROGS) $(SYMLINKS) cleanup_files+=$(EXECS) $(EXECS): build for f in $@; do \ @@ -191,8 +198,9 @@ install-exec: build-exec fi; \ $(INSTALL_PROGRAM) $$f $(BINPATH)/; \ done + cd $(BINPATH); for f in $(SYMLINKS); do ln -sf $(MAIN) $$f; done uninstall-exec: - -for f in $(notdir $(PROGS)); do rm -f $(BINPATH)/$$f; done + -for f in $(notdir $(PROGS) $(SYMLINKS)); do rm -f $(BINPATH)/$$f; done ; # Program + user documents installation. .PHONY: install-program uninstall-program @@ -277,15 +285,11 @@ osx-dmg: ../$(osx_dmg_name) -rm -f $(osx_dmg_name) mv $(osx_udzo_name) ../$(osx_dmg_name) -.PHONY: test test-markdown test-wrapper +.PHONY: test test-markdown test: $(MAIN) @cd $(TESTDIR) && perl runtests.pl -s $(PWD)/$(MAIN) test-markdown: $(MAIN) @cd $(TESTDIR)/MarkdownTest_1.0.3 && perl MarkdownTest.pl -s $(PWD)/$(MAIN) -tidy -cleanup_files+=testwrapper -test-wrappers: testwrapper - @echo "Running $<..." - @sh testwrapper # Stolen and slightly improved from a GPLed Makefile. Credits to John Meacham. src_all:=$(shell find $(SRCDIR) -type f -name '*hs' | egrep -v '^\./(_darcs|lib|test)/') -- cgit v1.2.3