Subversion Repositories gelsvn

Rev

Rev 178 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 178 Rev 393
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
### the user configuration makefile
7
include ${SOURCEROOT}/makefiles/config.mk
7
include ${SOURCEROOT}/makefiles/config.mk
8
 
8
 
9
### Include platform specific makefile
9
### Include platform specific makefile
10
include  ${SOURCEROOT}/makefiles/${PLATFORM}.mk
10
include  ${SOURCEROOT}/makefiles/${PLATFORM}.mk
11
 
11
 
12
### BUILD is the subdirectory where all builds reside.
12
### BUILD is the subdirectory where all builds reside.
13
BUILD								= .build
13
BUILD								= .build
14
 
14
 
15
### BUILDDIR is the directory where the compilation for a specific 
15
### BUILDDIR is the directory where the compilation for a specific 
16
### platform and target combination takes place.
16
### platform and target combination takes place.
17
BUILDDIR						= ./${BUILD}/$(PLATFORM_TARG)
17
BUILDDIR						= ./${BUILD}/$(PLATFORM_TARG)
18
 
18
 
19
### Append path to compiler flags
19
### Append path to compiler flags
20
CXXFLAGS						+= -I${SOURCEROOT}/src 
20
CXXFLAGS						+= -I${SOURCEROOT}/src 
21
 
21
 
22
### Generate list of source files.
22
### Generate list of source files.
23
sources							= $(shell ls *.cpp)
23
sources							= $(shell ls *.cpp)
24
### Generate list if object files from list of sources.
24
### Generate list if object files from list of sources.
25
objects							= $(sources:.cpp=.o)
25
objects							= $(sources:.cpp=.o)
26
### Generate list if dependency files from list of sources.
26
### Generate list if dependency files from list of sources.
27
deps								= $(addprefix ${BUILDDIR}/,$(sources:.cpp=.d))
27
deps								= $(addprefix ${BUILDDIR}/,$(sources:.cpp=.d))
28
 
28
 
29
### Set up vpath so that make finds object files in builddir
29
### Set up vpath so that make finds object files in builddir
30
### hence does not rebuild unneccesarily
30
### hence does not rebuild unneccesarily
31
VPATH 							= ${BUILDDIR}
31
VPATH 							= ${BUILDDIR}
32
 
32
 
33
 
33
 
34
### Make dependencies,
34
### Make dependencies,
35
ifneq (clean,$(findstring clean,${MAKECMDGOALS}))
35
ifneq (clean,$(findstring clean,${MAKECMDGOALS}))
36
${BUILDDIR}/%.d:%.cpp 
36
${BUILDDIR}/%.d:%.cpp 
37
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
37
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
38
	$(CXX) ${DEPFLAGS} ${CXXFLAGS} $< > $@
38
	$(CXX) ${DEPFLAGS} ${CXXFLAGS} $< > $@
39
 
39
 
40
### Include dependencies - but not if we are cleaning
40
### Include dependencies - but not if we are cleaning
41
include ${deps}
41
include ${deps}
42
endif
42
endif
43
 
43
 
44
### Rule for building object files from C++ source files
44
### Rule for building object files from C++ source files
45
%.o: %.cpp 
45
%.o: %.cpp 
46
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
46
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
47
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
47
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
48
 
48
 
49
### Rule for building object files from C source files
49
### Rule for building object files from C source files
50
### I use a C++ compiler. I think this is best.
50
### I use a C++ compiler. I think this is best.
51
%.o: %.c 
51
%.o: %.c 
52
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
52
	$(shell if \[ \! -d ${BUILDDIR} \] ; then mkdir -p ${BUILDDIR} ; fi)
53
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
53
	${CXX} -c ${CXXFLAGS} -o ${BUILDDIR}/$@ $<
54
 
54
 
55
 
55
 
56
 
56