Subversion Repositories gelsvn

Rev

Rev 113 | Rev 145 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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