Subversion Repositories gelsvn

Rev

Rev 6 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 137
Line 1... Line 1...
1
SHELL = /bin/sh
1
SHELL = /bin/sh
2
 
2
 
3
.SUFFIXES:
3
.SUFFIXES:
4
.SUFFIXES: .cpp .o .c
4
.SUFFIXES: .cpp .o .c
5
 
5
 
-
 
6
### the user configuration makefile
6
include ${SOURCEROOT}/makefiles/definitions.mk
7
include ${SOURCEROOT}/makefiles/config.mk
-
 
8
 
-
 
9
### Use a shell script to guess the compiler
-
 
10
ifeq ($(strip ${CXX}),)
-
 
11
CXX = $(shell ${SOURCEROOT}/makefiles/findcompiler.sh)
-
 
12
endif
-
 
13
 
-
 
14
### Define operating system and CPU
-
 
15
OS =$(subst ${empty} ${empty},_,$(shell uname -s))
-
 
16
CPU =$(subst ${empty} ${empty},_,$(shell uname -m))
-
 
17
 
-
 
18
### Define the empty string
-
 
19
empty =
-
 
20
 
-
 
21
### The platform is determined by OS CPU and compiler 
-
 
22
PLATFORM = ${OS}_${CPU}_${CXX}
-
 
23
 
-
 
24
### Default target is release, unless debug is given as goal
-
 
25
ifndef TARGET
-
 
26
TARGET = release
-
 
27
endif
-
 
28
 
-
 
29
### Concatenation of platform and target yields a string used as 
-
 
30
### suffix of makefiles and in the name of the builddir.
-
 
31
PLATFORM_TARG = ${PLATFORM}_$(TARGET)
7
 
32
 
8
### Include platform specific makefile
33
### Include platform specific makefile
9
include  ${SOURCEROOT}/makefiles/${PLATFORM}.mk
34
include  ${SOURCEROOT}/makefiles/${PLATFORM}.mk
10
 
35
 
11
### BUILD is the subdirectory where all builds reside.
36
### BUILD is the subdirectory where all builds reside.
Line 34... Line 59...
34
 
59
 
35
### Set up vpath so that make finds object files in builddir
60
### Set up vpath so that make finds object files in builddir
36
### hence does not rebuild unneccesarily
61
### hence does not rebuild unneccesarily
37
VPATH 							= ${BUILDDIR}
62
VPATH 							= ${BUILDDIR}
38
 
63
 
-
 
64
 
-
 
65
### Make dependencies,
-
 
66
ifneq (clean,$(findstring clean,${MAKECMDGOALS}))
-
 
67
${BUILDDIR}/%.d:%.cpp 
-
 
68
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
-
 
69
	$(CXX) ${DEPFLAGS} ${CXXFLAGS} $< > $@
-
 
70
 
39
### Include dependencies - but not if we are cleaning
71
### Include dependencies - but not if we are cleaning
40
ifneq (${MAKECMDGOALS},clean)
-
 
41
include ${deps}
72
include ${deps}
42
endif
73
endif
43
 
74
 
44
### Make dependencies, but first create BUILDDIR and LIBDIR.
-
 
45
${BUILDDIR}/%.d:%.cpp
-
 
46
	$(shell if \[ \! -d ${BUILD} \] ; then mkdir ${BUILD} ; fi)
-
 
47
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir ${BUILDDIR} ; fi)
-
 
48
	$(shell if \[ \! -d ${LIBDIR} \] ; then mkdir ${LIBDIR}; fi)
-
 
49
	$(CXX) ${DEPFLAGS} ${CXXFLAGS} $< > $@
-
 
50
 
-
 
51
### Rule for building object files from C++ source files
75
### Rule for building object files from C++ source files
52
%.o: %.cpp
76
%.o: %.cpp 
-
 
77
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
53
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
78
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
54
 
79
 
55
### Rule for building object files from C source files
80
### Rule for building object files from C source files
56
### I use a C++ compiler. I think this is best.
81
### I use a C++ compiler. I think this is best.
57
%.o: %.c
82
%.o: %.c 
-
 
83
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
58
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
84
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
59
 
85
 
60
 
86