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