aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-05-25 19:16:29 +0000
committerMike Buland <eichlan@xagasoft.com>2006-05-25 19:16:29 +0000
commit21d9613ac47b322316570b4b96b1906d479d49a2 (patch)
treeb3befe5adb7acfbaeda84f65884389a3c9120d68
downloadbuild-21d9613ac47b322316570b4b96b1906d479d49a2.tar.gz
build-21d9613ac47b322316570b4b96b1906d479d49a2.tar.bz2
build-21d9613ac47b322316570b4b96b1906d479d49a2.tar.xz
build-21d9613ac47b322316570b4b96b1906d479d49a2.zip
The initial structure has been made, now we start the real fun work...
-rw-r--r--Makefile54
-rw-r--r--src/main.cpp0
2 files changed, 54 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0be9792
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,54 @@
1SRC:=$(wildcard src/*.cpp)
2OBJS:=$(patsubst %.cpp,%.o,$(SRC))
3VER:=r$(shell svn info | grep "Revision" | cut -d\ -f2)
4LIBS:=bu++
5LIBDIRS:=$(patsubst %,lib%,$(LIBS))
6LIBFILES:=$(foreach dir,$(LIBDIRS),$(dir)/$(dir).a)
7DEPFILES:=$(patsubst %.o,%.d,$(OBJS))
8
9.PHONY: all clean dist checklibs
10
11all: checklibs src/version.h build
12
13checklibs:
14 for ldir in $(LIBDIRS); do make -C $$ldir; done
15
16-include $(DEPFILES)
17
18src/version.h: .svn
19 echo "#define SVNREV \"$(VER)\"" > src/version.h
20
21%.o: %.cpp %.d
22 g++ -ggdb $(CXXFLAGS) -Isrc $(patsubst %,-I%/src,$(LIBDIRS)) -c -o $@ $<
23
24clean:
25 -rm $(foreach dir,src,$(wildcard $(dir)/*.o)) build src/version.h
26
27depclean:
28 -rm $(foreach dir,src src/lib $(TOOLDIRS),$(wildcard $(dir)/*.d))
29
30%.d: %.cpp
31 g++ -Isrc -Isrc/lib $(CXXFLAGS) $(patsubst %,-I%/src,$(LIBDIRS)) -M $(CPPFLAGS) $< | sed 's,\($(patsubst src/%,%,$*)\)\.o[:]*,src/\1.o $@:,g' > $@
32
33$(LIBFILES):
34 make -C $(dir $@) $(notdir $@)
35
36test:
37 -build
38
39build: $(LIBFILES) $(OBJS)
40 g++ -ggdb $(OBJS) -o build $(patsubst %,-L%,$(LIBDIRS)) $(patsubst %,-l%,$(LIBS))
41
42api: $(LIBSRC) $(TOOLSRC)
43 sed 's/PROJECT_NUMBER.*/PROJECT_NUMBER = $(VER)/' < Doxyfile > Doxyfile.tmp
44 doxygen Doxyfile.tmp
45 rm Doxyfile.tmp
46 make -C api/latex
47
48dist: clean src/version.h
49 mkdir build-$(VER)
50 cp -a --target-directory=build-$(VER) Makefile src
51 tar --exclude=\.svn -c build-$(VER) | bzip2 -9 > build-$(VER).tar.bz2
52 rm -Rf build-$(VER)
53 -for dir in $(LIBDIRS); do make -C $$dir dist; done
54
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/main.cpp