.PHONY: test install util release
SHOW_OUTPUT := 1
PROJECT := chilon
default:
@echo "please run 'make install' to install this software, or 'make util' to compile the utility software"
include mk/Makefile
-include Makefile.config
prefix ?= /usr/local
util:
${MAKE} -C bin
test:
@for file in $(wildcard test/*/test.cpp) ; do \
test=$${file%.cpp}; \
echo "running $$test"; \
rm -f $$test; \
${CXX} -I.. $$file -o $$test; \
$$test $(if ${SHOW_OUTPUT},| tee,>) $$test.out; \
done
PRUNE_PATTERNS := -name '.git*' -prune -o -name bin -prune -o -name cmake -prune -o -name test -prune -o -name mk -prune -o
install:
@find . ${PRUNE_PATTERNS} -type d -exec mkdir -p ${DESTDIR}/${prefix}/include/chilon/{} \;
@find . ${PRUNE_PATTERNS} -type f -name '*.?pp' -exec install -m 664 {} ${DESTDIR}/${prefix}/include/chilon/{} \;
${MAKE} -C bin install prefix=${prefix} DESTDIR=${DESTDIR}
clean:
rm -f config.hpp Makefile.local Makefile.config
${MAKE} -C bin clean
dist:
cd doc && make
distDir=chilon-`git tag | tail -n1`; \
file=$$distDir.tar.gz ; touch $$file ; \
ln -sf . $$distDir ; \
tar chzvf $$file $(addprefix --exclude ,$$distDir/$$file $$distDir/config.hpp $$distDir/.git $$distDir/Makefile.config $$distDir/$$distDir '.git*' .obj) $$distDir ; \
rm $$distDir
%.s: test/%/test.cpp
${CXX} -S -O3 -I.. $< -o $@