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 |
|
|
|
23 |
include makefiles/definitions.mk
|
|
|
24 |
|
54 |
jab |
25 |
INSTALL_PREFIX = /usr/local
|
|
|
26 |
LIBSRC = ./src
|
|
|
27 |
LIBRARIES =$(dir $(shell cd ${LIBSRC}; find . -type f -name 'Makefile'))
|
|
|
28 |
APPSRC = ./apps
|
|
|
29 |
APPLICATIONS = $(dir $(shell cd ${APPSRC}; find . -type f -name 'Makefile'))
|
2 |
bj |
30 |
|
54 |
jab |
31 |
.PHONY: app lib clean distclean platform makefiles
|
2 |
bj |
32 |
|
|
|
33 |
all: lib app
|
|
|
34 |
|
|
|
35 |
lib:
|
54 |
jab |
36 |
$(foreach lib, ${LIBRARIES}, ${MAKE} -C ${LIBSRC}/${lib};)
|
2 |
bj |
37 |
|
|
|
38 |
app:
|
54 |
jab |
39 |
$(foreach app, ${APPLICATIONS}, ${MAKE} -C ${APPSRC}/${app};)
|
2 |
bj |
40 |
|
54 |
jab |
41 |
install:
|
|
|
42 |
$(foreach lib, ${LIBRARIES}, mkdir -p ${INSTALL_PREFIX}/include/GEL/${lib}; cp ${SOURCEROOT}/src/${lib}*.h ${INSTALL_PREFIX}/include/GEL/${lib};)
|
|
|
43 |
mkdir -p ${INSTALL_PREFIX}/lib/GEL_${TARGET}
|
|
|
44 |
cp ${SOURCEROOT}/lib/${PLATFORM_TARG}/* ${INSTALL_PREFIX}/lib/GEL_${TARGET}/.
|
|
|
45 |
|
2 |
bj |
46 |
clean:
|
54 |
jab |
47 |
$(foreach lib, ${LIBRARIES}, ${MAKE} -C ${LIBSRC}/${lib} clean;)
|
|
|
48 |
$(foreach app, ${APPLICATIONS}, ${MAKE} -C ${APPSRC}/${app} clean;)
|
2 |
bj |
49 |
|
|
|
50 |
distclean: clean
|
|
|
51 |
find ./lib -type d \! \( -name 'CVS' -o -name 'lib' \) -print > .remove
|
|
|
52 |
find ./bin -type f -print >> .remove
|
|
|
53 |
find . -name '.build' -type d -print >> .remove
|
|
|
54 |
find . -type f -name '*.o' -o -name '*.d' -o -name 'core' -o -name '*~' -print >> .remove
|
|
|
55 |
${RM} -fr `cat .remove`
|
|
|
56 |
${RM} -f .remove
|
|
|
57 |
|
|
|
58 |
platform: makefiles/${PLATFORM}.mk lib/${PLATFORM}
|
|
|
59 |
|
|
|
60 |
makefiles/${PLATFORM}.mk:
|
|
|
61 |
cp makefiles/PlatformTemplate.mk makefiles/${PLATFORM}.mk
|
|
|
62 |
|
|
|
63 |
lib/${PLATFORM}:
|
|
|
64 |
mkdir lib/${PLATFORM}
|