1 ##################################################
2 #Desc: Missing CLib Generator
5 ##################################################
6 #Included from buildc.make
7 #Defines vars for automatically downloading,
8 #compiling, and linking GNU-like C libraries
9 ##################################################
11 #Missing libraries will be downloaded
12 #to MLSRCDIR and installed at MLLIBDIR
14 MLSRCDIR
:= $(MLDIR
)/src
15 #If we aren't compiling for our own environment,
16 #we need to create a directory for that type of
18 ARCHLOCAL
:= $(shell uname
-m | grep
"$(CARCH)")
19 MLLIBDIR
:= $(if
$(ARCHLOCAL
),$(MLDIR
)/lib
,$(MLDIR
)/lib
$(CARCH
))
21 #Modify the dependency generator to find the right directory for
22 #missing lib includes (they are in MLDIR/src/libname/libname)
23 CDEPSCOMMAND
+= $(patsubst %, | sed
-e
's@ \(%\)/@$(MLSRCDIR)/\1/\1/@',$(MISSINGLIBS
))
25 #Automake vars for building libs
30 #Import the headers for each missing library (XTDIR/LIBNAME)
31 CFLAGS
+= -L
$(MLLIBDIR
) $(patsubst %,-I
$(MLSRCDIR
)/%,$(MISSINGLIBS
))
33 #Notify user of libraries that are about to be built
34 $(info Libraries to be built in
$(MLLIBDIR
):)
35 $(info $(patsubst %,lib
%.so
,$(MISSINGLIBS
)))
36 STATICLIBS
:= $(patsubst %,$(MLLIBDIR
)/lib
%.so
,$(MISSINGLIBS
))
38 #Ensure that C files depend on the creation of these static libs
39 CDEPS
+= $(STATICLIBS
)