1
.PHONY: test install util release
2
3
SHOW_OUTPUT := 1
4
PROJECT := chilon
5
6
default:
7
	@echo "please run 'make install' to install this software, or 'make util' to compile the utility software"
8
9
include mk/Makefile
10
-include Makefile.config
11
12
prefix ?= /usr/local
13
14
util:
15
	${MAKE} -C bin
16
17
test:
18
	@for file in $(wildcard test/*/test.cpp) ; do \
19
		test=$${file%.cpp}; \
20
		echo "running $$test"; \
21
		rm -f $$test; \
22
		${CXX} -I.. $$file -o $$test; \
23
		$$test $(if ${SHOW_OUTPUT},| tee,>) $$test.out; \
24
	done
25
26
PRUNE_PATTERNS := -name '.git*' -prune -o -name bin -prune -o -name cmake -prune -o -name test -prune -o -name mk -prune -o
27
install:
28
	@find . ${PRUNE_PATTERNS} -type d -exec mkdir -p ${DESTDIR}/${prefix}/include/chilon/{} \;
29
	@find . ${PRUNE_PATTERNS} -type f -name '*.?pp' -exec install -m 664 {} ${DESTDIR}/${prefix}/include/chilon/{} \;
30
	${MAKE} -C bin install prefix=${prefix} DESTDIR=${DESTDIR}
31
32
clean:
33
	rm -f config.hpp Makefile.local Makefile.config
34
	${MAKE} -C bin clean
35
36
dist:
37
	cd doc && make
38
	distDir=chilon-`git tag | tail -n1`; \
39
	file=$$distDir.tar.gz ; touch $$file ; \
40
	ln -sf . $$distDir ; \
41
	tar chzvf $$file $(addprefix --exclude ,$$distDir/$$file $$distDir/config.hpp $$distDir/.git $$distDir/Makefile.config $$distDir/$$distDir '.git*' .obj) $$distDir ; \
42
	rm $$distDir
43
44
%.s: test/%/test.cpp
45
	${CXX} -S -O3 -I.. $< -o $@