2 |
bj |
1 |
### Make sure our default action is to rebuild library
|
|
|
2 |
all: lib
|
|
|
3 |
|
|
|
4 |
### Include definitions and rules common to the library and the
|
|
|
5 |
### application makefiles
|
|
|
6 |
include ${SOURCEROOT}/makefiles/common.mk
|
|
|
7 |
|
|
|
8 |
### Name of library is derived from name of present working directory.
|
|
|
9 |
LIB = ${LIBDIR}/lib$(notdir $(shell pwd)).a
|
|
|
10 |
|
|
|
11 |
######################################################################
|
|
|
12 |
############# if we are cleaning #####################################
|
|
|
13 |
ifeq (${MAKECMDGOALS},clean)
|
|
|
14 |
|
|
|
15 |
### Clean simply removes the build and library directories
|
|
|
16 |
clean:
|
|
|
17 |
rm -fr ${BUILDDIR}
|
|
|
18 |
rm -fr ${LIB}
|
|
|
19 |
.PHONY: clean
|
|
|
20 |
|
|
|
21 |
else
|
|
|
22 |
######################################################################
|
|
|
23 |
############ Otherwise we are building ###############################
|
|
|
24 |
|
|
|
25 |
lib: ${LIB}
|
|
|
26 |
|
|
|
27 |
### Rule for creating the library.
|
|
|
28 |
${LIB}:${objects}
|
|
|
29 |
${AR} ${LIB} $(addprefix ${BUILDDIR}/,$(objects))
|
|
|
30 |
|
|
|
31 |
endif
|
|
|
32 |
|