Another fix for Makefile.
[cppu.git] / Makefile
blob4ef778ca2ecf0a26e8e617a61c11042e582b8538
1 GCC = g++
2 CXXFLAGS = -pedantic -Wall
3 DEBUGFLAGS = -g
5 INSTALL = install
6 RM = rm
7 DESTDIR = /usr/local
9 VERSION = 0.3
11 all: libcppu.a
13 libcppu.a: cppu.o
14 ar cr $@ $^
15 ranlib $@
17 cppu.o: cppu.cpp cppu.h
18 $(GCC) $(CXXFLAGS) $(DEBUGFLAGS) -c -o $@ $<
20 archive: libcppu.a cppu.h
21 git archive --prefix=cppu-$(VERSION)/ --format=tar v$(VERSION) | gzip > \
22 cppu-$(VERSION).tar.gz
24 install: libcppu.a cppu.h
25 $(INSTALL) -d -m755 $(DESTDIR)/lib
26 $(INSTALL) -d -m755 $(DESTDIR)/include
27 $(INSTALL) -d -m755 $(DESTDIR)/bin
28 $(INSTALL) -m644 libcppu.a $(DESTDIR)/lib/libcppu.a
29 $(INSTALL) -m644 cppu.h $(DESTDIR)/include/cppu.h
30 $(INSTALL) -m755 cppu-aggregate $(DESTDIR)/bin/cppu-aggregate
32 uninstall:
33 $(RM) $(DESTDIR)/lib/libcppu.a
34 $(RM) $(DESTDIR)/include/cppu.h
35 $(RM) $(DESTDIR)/bin/cppu-aggregate
37 doc:
38 doxygen doc/doxygen.conf
40 todo:
41 todo cppu.h cppu.cpp
43 clean:
44 rm -f *.o
45 rm -f test
46 rm -f *.a
47 rm -rf doc/html
48 rm -f doc/test
49 rm -f *.tar.gz
51 test: doc/test
52 doc/test: cppu.o doc/example.cpp
53 $(GCC) $(CXXFLAGS) $(DEBUGFLAGS) -I./ -o doc/test $^
54 run_test:
55 cd doc && ./test
57 .PHONY: clean doc install uninstall archive