File: Makefile

package info (click to toggle)
camltemplate 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 912 kB
  • ctags: 504
  • sloc: ml: 2,427; makefile: 299; sh: 51
file content (94 lines) | stat: -rw-r--r-- 2,175 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
DIRS := src examples doc
VERSION := $(shell grep version src/META | sed -e 's/version="//' -e 's/".*//')
DIST_DIR := camltemplate-$(VERSION)

# PKGBASE is provided by GODIVA.
ifeq ($(PKGBASE),)
PKGBASE := camltemplate
endif
export PKGBASE

# Builds bytecode.
.PHONY: all
all: Makefile.config
	cd src; $(MAKE) all
	cd examples; $(MAKE) all

# Builds native code.
.PHONY: opt
opt: Makefile.config
	cd src; $(MAKE) opt

# Builds HTML documentation.
.PHONY: htdoc
htdoc: Makefile.config
	cd doc; make htdoc

# Builds documentation in all formats.
.PHONY: pdfdoc
pdfdoc: Makefile.config
	cd doc; make pdfdoc

# Runs a regression test.
.PHONY: test
test:
	test/test.sh

# Installs the library.
.PHONY: install
install: Makefile.config
	cd src; $(MAKE) install
	cd doc; $(MAKE) install
	cd examples; $(MAKE) install

# Uninstalls the library.
.PHONY: uninstall
uninstall: Makefile.config
	cd src; $(MAKE) uninstall
	cd doc; $(MAKE) uninstall
	cd examples; $(MAKE) uninstall

# Creates a distribution tarball.
.PHONY: dist
dist: distclean all htdoc pdfdoc
	set -e; \
	./configure; \
	rm -rf $(DIST_DIR)*; \
	files=`ls`; \
	mkdir $(DIST_DIR); \
	cp -r $$files $(DIST_DIR); \
	find $(DIST_DIR) -type d -name CVS -prune -exec rm -rf \{} \;
	cd $(DIST_DIR); \
	for dir in $(DIRS); do \
		if [ $$dir != "doc" ]; then \
			cd $$dir; $(MAKE) clean; cd ..; \
		fi; \
	done; \
	cd doc; $(MAKE) distclean; cd ../..; \
	rm -f $(DIST_DIR)/Makefile.config; \
	tar zcf $(DIST_DIR).tar.gz $(DIST_DIR); \
	rm -rf $(DIST_DIR)

# Copies the distribution and docs into the SauceCode web site.
.PHONY: webinstall
webinstall: $(DIST_DIR).tar.gz
	cp -r doc/html/api doc/html/manual ../../saucecode-site/saucecode.org/htdocs/camltemplate
	mkdir -p ../../saucecode-site/saucecode.org/htdocs/camltemplate/releases
	cp $(DIST_DIR).tar.gz ../../saucecode-site/saucecode.org/htdocs/camltemplate/releases

# Deletes generated files.
.PHONY: clean
clean:
	for dir in $(filter-out doc,$(DIRS)); do $(MAKE) -C $$dir clean; done
	-$(RM) -r *~ camltemplate-*

.PHONY: distclean
distclean: clean
	$(RM) Makefile.config

.PHONY: really-clean
really-clean: distclean
	$(MAKE) -C doc clean

Makefile.config:
	./configure