Switched to git
[ttodo.git] / Makefile
blob91b57d0bdfb4c513b81e3eb351f70d4dea586a5e
1 include Config.mk
3 ################ Source files ########################################
5 SRCS = $(wildcard *.cc)
6 OBJS = $(SRCS:.cc=.o)
8 ################ Compilation #########################################
10 .PHONY: all install uninstall
11 .PHONY: clean depend html check dist distclean maintainer-clean
13 all: ${EXE}
15 ${EXE}: ${OBJS}
16 @echo "Linking $@ ..."
17 @${LD} ${LDFLAGS} -o $@ $^ ${LIBS}
19 %.o: %.cc
20 @echo " Compiling $< ..."
21 @${CXX} ${CXXFLAGS} -o $@ -c $<
23 %.s: %.cc
24 @echo " Compiling $< to assembly ..."
25 @${CXX} ${CXXFLAGS} -S -g0 -Os -DNDEBUG=1 -fomit-frame-pointer -o $@ -c $<
27 html:
29 ################ Installation ########################################
31 INSTALLDIR = ${INSTALL} -d
32 INSTALLBIN = ${INSTALL} -s -p -m 755
34 install: ${EXE}
35 @echo "Installing ${EXE} to ${BINDIR} ..."
36 @${INSTALLDIR} ${BINDIR}
37 @${INSTALLBIN} ${EXE} ${BINDIR}
39 uninstall:
40 @echo "Removing ${EXE} from ${BINDIR} ..."
41 @rm -f ${BINDIR}/${EXE}
43 ################ Maintenance ###########################################
45 clean:
46 @echo "Removing generated files ..."
47 @rm -f ${EXE} ${OBJS} ${TOCLEAN}
49 depend: ${SRCS}
50 @rm -f .depend
51 @for i in ${SRCS}; do \
52 ${CXX} ${CXXFLAGS} -M -MT $${i%%.cc}.o $$i >> .depend; \
53 done
55 TMPDIR = /tmp
56 DISTDIR = ${HOME}/stored
57 DISTNAM = ${EXE}-${MAJOR}.${MINOR}
58 DISTTAR = ${DISTNAM}.${BUILD}.tar.bz2
60 dist:
61 mkdir ${TMPDIR}/${DISTNAM}
62 cp -r . ${TMPDIR}/${DISTNAM}
63 +make -C ${TMPDIR}/${DISTNAM} html distclean
64 (cd ${TMPDIR}/${DISTNAM}; rm -rf `find . -name .svn`)
65 (cd ${TMPDIR}; tar jcf ${DISTDIR}/${DISTTAR} ${DISTNAM}; rm -rf ${DISTNAM})
67 distclean: clean
68 @rm -f Config.mk config.h bsconf.o bsconf .depend
70 maintainer-clean: distclean
71 @rm -rf docs/html
73 -include .depend