git.iko.soy/typeable/pandoc
on master help sign in
Removed obsolete Makefile.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1817 788f1e2b-df1e-0410-8736-df70ead52e1b

commit0fb6a1b5af17ff1a4e2c3e75e42034fbc45b2a63 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 17 Jan 2010, 08:45 (17 years ago) parentd7f2d6c
1 file changed−290
Makefile−290
Makefiledeleted−290
@@ -1,290 +0,0 @@
1−# Makefile for Pandoc.
2−
3−#-------------------------------------------------------------------------------
4−# Constant names and commands in source tree
5−#-------------------------------------------------------------------------------
6−CABAL := pandoc.cabal
7−SRCDIR := src
8−MANDIR := man
9−TESTDIR := tests
10−BUILDDIR := dist
11−BUILDCONF := $(BUILDDIR)/setup-config
12−BUILDVARS := vars
13−CONFIGURE := configure
14−
15−#-------------------------------------------------------------------------------
16−# Cabal constants
17−#-------------------------------------------------------------------------------
18−PKG := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL) | tr A-Z a-z)
19−VERSION := $(shell sed -ne 's/^[Vv]ersion:[[:space:]]*//p' $(CABAL))
20−PKGID := $(PKG)-$(VERSION)
21−EXECSBASE := pandoc
22−
23−#-------------------------------------------------------------------------------
24−# Install targets
25−#-------------------------------------------------------------------------------
26−WRAPPERS := html2markdown hsmarkdown markdown2pdf
27−# Add .exe extensions if we're running Windows/Cygwin.
28−EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | \
29− sed -ne 's/^cygwin.*$$/\.exe/p')
30−BUILDCMD := $(addsuffix $(EXTENSION), ./setup)
31−EXECS := $(addsuffix $(EXTENSION),$(EXECSBASE))
32−PROGS := $(EXECS) $(WRAPPERS)
33−MAIN := $(firstword $(EXECS))
34−DOCS := README.html README BUGS
35−MANPAGES := $(patsubst %.md,%,$(wildcard $(MANDIR)/man?/*.?.md))
36−
37−#-------------------------------------------------------------------------------
38−# Variables to setup through environment
39−#-------------------------------------------------------------------------------
40−
41−# Specify default values.
42−prefix := /usr/local
43−destdir :=
44−# Attempt to set variables from a previous make session.
45−-include $(BUILDVARS)
46−# Fallback to defaults but allow to get the values from environment.
47−PREFIX ?= $(prefix)
48−DESTDIR ?= $(destdir)
49−DATADIR ?= $(PKGID)
50−DOCDIR ?= $(PKGID)/doc
51−
52−#-------------------------------------------------------------------------------
53−# Installation paths
54−#-------------------------------------------------------------------------------
55−DESTPATH := $(DESTDIR)$(PREFIX)
56−BINPATH := $(DESTPATH)/bin
57−DATAPATH := $(DESTPATH)/share
58−MANPATH := $(DATAPATH)/man
59−PKGDATAPATH := $(DATAPATH)/$(DATADIR)
60−PKGDOCPATH := $(DATAPATH)/$(DOCDIR)
61−
62−#-------------------------------------------------------------------------------
63−# Generic Makefile variables
64−#-------------------------------------------------------------------------------
65−INSTALL := install -c
66−INSTALL_PROGRAM := $(INSTALL) -m 755
67−INSTALL_DATA := $(INSTALL) -m 644
68−STRIP := strip
69−GHC ?= ghc
70−GHC_VERSION := $(shell $(GHC) --version | sed -e 's/[^0-9]*//')
71−
72−#-------------------------------------------------------------------------------
73−# Recipes
74−#-------------------------------------------------------------------------------
75−
76−# Default target.
77−.PHONY: all
78−all: build-program
79−
80−# Document process rules.
81−%.html: % $(MAIN)
82− ./$(MAIN) -s --template templates/html.template -S --toc $< >$@ || rm -f $@
83−%.tex: % $(MAIN)
84− ./$(MAIN) -s --template templates/latex.template -w latex $< >$@ || rm -f $@
85−%.rtf: % $(MAIN)
86− ./$(MAIN) -s --template templates/rtf.template -w rtf $< >$@ || rm -f $@
87−%.pdf: % $(MAIN) markdown2pdf
88− sh ./markdown2pdf --template templates/latex.template $< || rm -f $@
89−%.txt: %
90− perl -p -e 's/\n/\r\n/' $< > $@ || rm -f $@ # convert to DOS line endings
91−
92−.PHONY: configure
93−cleanup_files+=Setup.hi Setup.o $(BUILDCMD) $(BUILDVARS)
94−ifdef GHC_PKG
95− hc_pkg = --with-hc-pkg=$(GHC_PKG)
96−else
97− hc_pkg =
98−endif
99−templates=$(wildcard templates/*.* templates/headers/*.* templates/ui/default/*.*)
100−configure: $(BUILDCONF)
101−$(BUILDCMD): Setup.hs
102− $(GHC) -package Cabal Setup.hs -o $(BUILDCMD)
103−$(BUILDCONF): $(CABAL) $(CABAL_BACKUP) $(BUILDCMD) $(templates)
104− $(BUILDCMD) configure --prefix=$(PREFIX) --with-compiler=$(GHC) $(hc_pkg) $(CABALOPTS) -f-wrappers
105− @# Make configuration time settings persistent (definitely a hack).
106− @echo "PREFIX?=$(PREFIX)" >$(BUILDVARS)
107− @echo "DESTDIR?=$(DESTDIR)" >>$(BUILDVARS)
108−
109−.PHONY: build
110−build: configure
111− $(BUILDCMD) build
112−
113−.PHONY: build-exec
114−build-exec: $(PROGS)
115−cleanup_files+=$(EXECS)
116−$(EXECS): build
117− for f in $@; do \
118− find $(BUILDDIR) -type f -name "$$f" -perm +a=x \
119− -exec ln -s -f {} . \; ; \
120− done
121−
122−.PHONY: build-doc
123−cleanup_files+=README.html
124−build-doc: $(DOCS)
125−
126−.PHONY: build-program
127−build-program: build-exec build-doc
128−
129−.PHONY: build-lib-doc haddock
130−build-lib-doc: html
131−haddock: build-lib-doc
132−cleanup_files+=html
133−html/: configure
134− -rm -rf html
135− $(BUILDCMD) haddock && cp -r $(BUILDDIR)/doc/html .
136−
137−.PHONY: build-all
138−build-all: build-program build-lib-doc
139−
140−# User documents installation.
141−.PHONY: install-doc uninstall-doc
142−man_all:=$(patsubst $(MANDIR)/%,%,$(MANPAGES))
143−install-doc: build-doc
144− $(INSTALL) -d $(PKGDOCPATH) && $(INSTALL_DATA) $(DOCS) $(PKGDOCPATH)/
145− for f in $(man_all); do \
146− $(INSTALL) -d $(MANPATH)/$$(dirname $$f); \
147− $(INSTALL_DATA) $(MANDIR)/$$f $(MANPATH)/$$f; \
148− done
149−uninstall-doc:
150− -for f in $(DOCS); do rm -f $(PKGDOCPATH)/$$f; done
151− -for f in $(man_all); do rm -f $(MANPATH)/$$f; done
152− rmdir $(PKGDOCPATH) 2>/dev/null ||:
153−
154−# Program only installation.
155−.PHONY: install-exec uninstall-exec
156−install-exec: build-exec
157− $(STRIP) $(EXECS)
158− $(INSTALL) -d $(BINPATH); \
159− for f in $(PROGS); do \
160− if [ -L $$f ]; then \
161− f=$$(readlink $$f); \
162− fi; \
163− $(INSTALL_PROGRAM) $$f $(BINPATH)/; \
164− done
165−uninstall-exec:
166− -for f in $(notdir $(PROGS)); do rm -f $(BINPATH)/$$f; done
167−
168−# Program + user documents installation.
169−.PHONY: install-program uninstall-program
170−install-program: install-exec install-doc
171−uninstall-program: uninstall-exec uninstall-doc
172−
173−.PHONY: install-all uninstall-all
174−# Full installation through Cabal: main + wrappers + user docs + lib + lib docs
175−install-all: build-all install-program
176− destdir=$(DESTDIR); \
177− # Older Cabal versions have no '--destdir' option.
178− if $(BUILDCMD) copy --help | grep -q '\-\-destdir'; then \
179− opt="--destdir=$${destdir-/}"; \
180− else \
181− opt="--copy-prefix=$${destdir}$(PREFIX)"; \
182− fi; \
183− $(BUILDCMD) copy $$opt; $(BUILDCMD) register
184−# Cabal lacks an 'uninstall' command. We have to remove some cruft manually.
185−uninstall-all: uninstall-program configure
186− @libdir=$$($(GHC_PKG) field $(PKGID) library-dirs 2>/dev/null | \
187− sed 's/^library-dirs: *//'); \
188− htmldir=$$($(GHC_PKG) field $(PKGID) haddock-html 2>/dev/null | \
189− sed 's/^haddock-html: *//'); \
190− if [ -d $$libdir ]; then \
191− $(BUILDCMD) unregister ||:; \
192− else \
193− echo >&2 "*** Couldn't locate library for pkgid: $(PKGID). ***"; \
194− fi; \
195− for d in $$libdir $$htmldir; do \
196− [ -d $$d ] && { \
197− rm -rf $$d; rmdir $$(dirname $$d) 2>/dev/null ||:; \
198− } \
199− done; \
200− rmdir $(PKGDOCPATH) $(PKGDATAPATH) 2>/dev/null ||:
201−
202−# Default installation recipe for a common deployment scenario.
203−.PHONY: install uninstall
204−install: install-program
205−uninstall: uninstall-program
206−
207−# FreeBSD port
208−.PHONY: freebsd
209−freebsd_dest:=freebsd
210−freebsd_makefile:=$(freebsd_dest)/Makefile
211−freebsd_template:=$(freebsd_makefile).in
212−cleanup_files+=$(freebsd_makefile)
213−freebsd : $(freebsd_makefile)
214−$(freebsd_makefile) : $(freebsd_template)
215− sed -e 's/@VERSION@/$(VERSION)/' $< > $@
216−
217−# MacPort
218−.PHONY: macport
219−macport_dest:=macports
220−portfile:=$(macport_dest)/Portfile
221−portfile_template:=$(portfile).in
222−cleanup_files+=$(portfile)
223−macport : $(portfile)
224−$(portfile) : $(portfile_template) tarball
225− sed -e 's/@VERSION@/$(VERSION)/' $(portfile_template) | \
226− sed -e 's/@TARBALLMD5SUM@/$(word 2, $(shell openssl md5 $(tarball)))/' > \
227− $(portfile)
228−
229−.PHONY: test test-markdown
230−test: $(MAIN)
231− $(BUILDCMD) test
232−compat:=$(PWD)/hsmarkdown
233−markdown_test_dirs:=$(wildcard $(TESTDIR)/MarkdownTest_*)
234−test-markdown: $(MAIN) $(compat)
235− @for suite in $(markdown_test_dirs); do \
236− ( \
237− suite_version=$$(echo $$suite | sed -e 's/.*_//');\
238− echo >&2 "-----------------------------------------";\
239− echo >&2 "Running Markdown test suite version $${suite_version}.";\
240− PATH=$(PWD):$$PATH; export PATH; cd $$suite && \
241− perl MarkdownTest.pl -s $(compat) -tidy ; \
242− ) \
243− done
244−
245−# Stolen and slightly improved from a GPLed Makefile. Credits to John Meacham.
246−src_all:=$(shell find $(SRCDIR) -type f -name '*hs' | egrep -v '^\./(_darcs|lib|test)/')
247−cleanup_files+=$(patsubst %,$(SRCDIR)/%,tags tags.sorted)
248−tags: $(src_all)
249− cd $(SRCDIR) && hasktags -c $(src_all:$(SRCDIR)/%=%); \
250− LC_ALL=C sort tags >tags.sorted; mv tags.sorted tags
251−
252−.PHONY: tarball
253−tarball:=$(PKGID).tar.gz
254−cleanup_files+=$(tarball)
255−tarball: $(tarball)
256−$(tarball):
257− $(BUILDCMD) sdist
258− cp $(BUILDDIR)/$(tarball) .
259−
260−.PHONY: website
261−web_src:=web
262−web_dest:=pandoc-website
263−make_page:=./$(MAIN) -s --template templates/html.template \
264− -S -B $(web_src)/header.html \
265− -A $(web_src)/footer.html \
266− -H $(web_src)/css
267−cleanup_files+=$(web_dest)
268−$(web_dest) : html $(wildcard $(web_src)/*) changelog \
269− INSTALL $(MANPAGES) $(MANDIR)/man1/pandoc.1.md README
270− rm -rf $(web_dest) && { \
271− mkdir $(web_dest); \
272− cp -r html $(web_dest)/doc; \
273− cp $(web_src)/* $(web_dest)/; \
274− sed -e 's#@VERSION@#$(VERSION)#g' $(web_src)/index.txt.in > \
275− $(web_dest)/index.txt; \
276− cp changelog $(web_dest)/changelog.txt ; \
277− cp README $(web_dest)/ ; \
278− cp INSTALL $(web_dest)/ ; \
279− cp $(MANDIR)/man1/pandoc.1.md $(web_dest)/ ; \
280− cp $(MANPAGES) $(web_dest)/ ; \
281− } || { rm -rf $(web_dest); exit 1; }
282−website: $(MAIN) $(web_dest)
283− PANDOC_PATH=$(shell pwd) make -C $(web_dest)
284−
285−.PHONY: distclean clean
286−distclean: clean
287−
288−clean:
289− -if [ -f $(BUILDCONF) ]; then $(BUILDCMD) clean; fi
290− -rm -rf $(cleanup_files)