Subversion Repositories gelsvn

Rev

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

Rev 113 Rev 119
1
SHELL = /bin/sh
1
SHELL = /bin/sh
2
########################################################################
2
########################################################################
3
#
3
#
4
# Central makefile. Descends all source directories, making recursively.
4
# Central makefile. Descends all source directories, making recursively.
5
#
5
#
6
# Targets:
6
# Targets:
7
#
7
#
8
#  all       - make all libraries, then all applications
8
#  all       - make all libraries, then all applications
9
#  cvs       - add all cpp h and Makefile files to cvs
9
#  cvs       - add all cpp h and Makefile files to cvs
10
#  lib       - make all libraries
10
#  lib       - make all libraries
11
#  app       - make all applications
11
#  app       - make all applications
12
#  clean     - clean all library directories and app directories.
12
#  clean     - clean all library directories and app directories.
13
#  this removes only files pertaining to the current platform and
13
#  this removes only files pertaining to the current platform and
14
#	 target (release/debug). This also removes generated libraries.
14
#	 target (release/debug). This also removes generated libraries.
15
#  distclean - removes all build directories. 
15
#  distclean - removes all build directories. 
16
#  platform  - copies a template to OS_CPU_COMPILER.mk in the makefiles
16
#  platform  - copies a template to OS_CPU_COMPILER.mk in the makefiles
17
#			directory
17
#			directory
18
#
18
#
19
########################################################################
19
########################################################################
20
 
20
 
21
override SOURCEROOT		= $(shell pwd)
21
override SOURCEROOT		= $(shell pwd)
22
 
22
 
23
include makefiles/definitions.mk
23
include makefiles/definitions.mk
24
 
24
 
25
INSTALL_PREFIX = /usr/local
25
INSTALL_PREFIX = /usr/local
26
LIBSRC 				 = ./src
26
LIBSRC 				 = ./src
27
LIBRARIES 		 =$(dir $(shell cd ${LIBSRC}; find . -type f -name 'Makefile'))
27
LIBRARIES 		 =$(dir $(shell cd ${LIBSRC}; find . -type f -name 'Makefile'))
28
 
28
 
29
APPSRC 			 	 = ./apps
29
APPSRC 			 	 = ./apps
30
APPLICATIONS 	 = $(dir $(shell cd ${APPSRC}; find . -type f -name 'Makefile'))
30
APPLICATIONS 	 = $(dir $(shell cd ${APPSRC}; find . -type f -name 'Makefile'))
31
 
31
 
32
TESTSRC 			 	 = ./test
32
TESTSRC 			 	 = ./test
33
TESTAPPS 	 = $(dir $(shell cd ${TESTSRC}; find . -type f -name 'Makefile'))
33
TESTAPPS 	 = $(dir $(shell cd ${TESTSRC}; find . -type f -name 'Makefile'))
34
 
34
 
35
.PHONY: test app lib clean distclean platform makefiles
35
.PHONY: test app lib clean distclean platform makefiles
36
 
36
 
37
all: lib test app
37
all: lib test app
38
 
38
 
39
lib: 
39
lib: 
40
	$(foreach lib, ${LIBRARIES},	${MAKE} -C ${LIBSRC}/${lib};)
40
	$(foreach lib, ${LIBRARIES},	${MAKE} -C ${LIBSRC}/${lib};)
41
 
41
 
42
app:
42
app:
43
	$(foreach app, ${APPLICATIONS},	${MAKE} -C ${APPSRC}/${app};)
43
	$(foreach app, ${APPLICATIONS},	${MAKE} -C ${APPSRC}/${app};)
44
 
44
 
45
test:
45
test:
46
	$(foreach test, ${TESTAPPS},	${MAKE} -C ${TESTSRC}/${test};)
46
	$(foreach test, ${TESTAPPS},	${MAKE} -C ${TESTSRC}/${test};)
47
 
47
 
48
install:
48
install:
49
	$(foreach lib, ${LIBRARIES}, mkdir -p ${INSTALL_PREFIX}/include/GEL/${lib}; cp ${SOURCEROOT}/src/${lib}*.h ${INSTALL_PREFIX}/include/GEL/${lib};)
49
	$(foreach lib, ${LIBRARIES}, mkdir -p ${INSTALL_PREFIX}/include/GEL/${lib}; cp ${SOURCEROOT}/src/${lib}*.h ${INSTALL_PREFIX}/include/GEL/${lib};)
50
	mkdir -p ${INSTALL_PREFIX}/lib/GEL_${TARGET}
50
	mkdir -p ${INSTALL_PREFIX}/lib/GEL_${TARGET}
51
	cp ${SOURCEROOT}/lib/${PLATFORM_TARG}/* ${INSTALL_PREFIX}/lib/GEL_${TARGET}/.
51
	cp ${SOURCEROOT}/lib/${PLATFORM_TARG}/* ${INSTALL_PREFIX}/lib/GEL_${TARGET}/.
52
 
52
 
53
clean:
53
clean:
54
	$(foreach lib, ${LIBRARIES},	${MAKE} -C ${LIBSRC}/${lib} clean;)
54
	$(foreach lib, ${LIBRARIES},	${MAKE} -C ${LIBSRC}/${lib} clean;)
55
	$(foreach app, ${APPLICATIONS},	${MAKE} -C ${APPSRC}/${app} clean;)
55
	$(foreach app, ${APPLICATIONS},	${MAKE} -C ${APPSRC}/${app} clean;)
56
	$(foreach app, ${TESTAPPS},	${MAKE} -C ${TESTSRC}/${app} clean;)
56
	$(foreach app, ${TESTAPPS},	${MAKE} -C ${TESTSRC}/${app} clean;)
57
 
57
 
58
distclean: clean
58
distclean: clean
59
	find ./lib -type d \! \( -name 'CVS' -o -name 'lib' \) -print > .remove
59
	find ./lib -type d \! \( -name 'CVS' -o -name 'lib' \) -print > .remove
60
	find ./bin -type f -print >> .remove
60
	find ./bin -type f -print >> .remove
61
	find . -name '.build' -type d -print >> .remove
61
	find . -name '.build' -type d -print >> .remove
62
	find . -type f -name '*.o' -o -name '*.d' -o -name 'core' -o -name '*~' -print >> .remove
62
	find . -type f -name '*.o' -o -name '*.d' -o -name 'core' -o -name '*~' -print >> .remove
63
	${RM} -fr `cat .remove`
63
	${RM} -fr `cat .remove`
64
	${RM} -f  .remove
64
	${RM} -f  .remove
65
 
65
 
66
platform: makefiles/${PLATFORM}.mk lib/${PLATFORM}
66
platform: makefiles/${PLATFORM}.mk lib/${PLATFORM}
67
 
67
 
68
makefiles/${PLATFORM}.mk:
68
makefiles/${PLATFORM}.mk:
69
	cp makefiles/PlatformTemplate.mk makefiles/${PLATFORM}.mk
69
	cp makefiles/PlatformTemplate.mk makefiles/${PLATFORM}.mk
70
 
70
 
71
lib/${PLATFORM}:
71
lib/${PLATFORM}:
72
	mkdir lib/${PLATFORM}
72
	mkdir lib/${PLATFORM}
73
 
73