-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmakefile-inc
81 lines (65 loc) · 4.5 KB
/
makefile-inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
##############################################################################
############################### makefile-inc #################################
##############################################################################
# #
# makefile of libMCFCl as a pre-built library #
# #
# This makefile is thought to be included by the makefile of some code #
# using the libMCFCl library. However, this makefile treats libMCFCl as #
# a pre-built library, in the sense that it ensures that it is built and #
# then returns as $(libMCFClOBJ) the complete libMCFCl library together #
# with macros $(libMCFClINC) and $(libMCFClLIB) for includes and external #
# libraries, but not $(libMCFClH). #
# #
# Input: $(libMCFClDIR) = the directory where the libMCFCl source is #
# #
# MCFC_NO_PATHS if the macro is defined (irrespectively from #
# the value it has) then the two files #
# $(libMCFClDIR)/extlib/makefile-default-paths #
# and $(libMCFClDIR)/extlib/makefile-paths are #
# *not* read (the second one, optionally) to #
# define the *_ROOT macros that contain the #
# install locations of the external libraries #
# needed by MCFClass, which means that they are #
# either not needed or defined already by #
# whichever "main" makefile is including this #
# #
# Output: there is no $(libMCFClH) output, since the calling makefile has #
# no need to check for changes in the .h and rebuild the .a: this #
# is all done here inside. However, the following macros are #
# provided because the code using libMCFCl need to know where to #
# find the .h files to include, which external libraries and #
# -L< libdirs > need be used in the linking phase, and of course #
# libMCFCl.a need be linked against. #
# $(libMCFClINC) = the -I$( include directories ) for libMCFCl #
# $(libMCFClLIB) = external libraries + -L< libdirs > for libMCFCl #
# $(libMCFClOBJ) = the libMCFCl.a library itself #
# #
# Internally, the makefile calls makefile-c, strips away the *H macro and #
# redefines the *OBJ one. #
# #
# Antonio Frangioni #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# include the libMCFCl makefile internally defining all external modules - - - -
include $(libMCFClDIR)/lib/makefile-c
# copy the list of object files, using ":=" to ensure it remains the same
# even after that libMCFClOBJ is redefined later on
libMCFCl_LOCAL_OBJ := $(libMCFClOBJ)
# define the local name for the library - - - - - - - - - - - - - - - - - - -
libMCFCl_LOCAL_LIB = $(libMCFClDIR)/lib/libMCFCl.a
# default target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
default: $(libMCFCl_LOCAL_LIB)
# clean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean::
rm -f $(libMCFCl_LOCAL_LIB)
# archive the library - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$(libMCFCl_LOCAL_LIB): $(libMCFCl_LOCAL_OBJ)
ar -ruv $(libMCFCl_LOCAL_LIB) $(libMCFCl_LOCAL_OBJ)
# re-define the OBJ as the library- - - - - - - - - - - - - - - - - - - - - -
libMCFClOBJ = $(libMCFCl_LOCAL_LIB)
# clean-up unrequired things- - - - - - - - - - - - - - - - - - - - - - - - -
libMCFClH =
########################## End of makefile-inc ###############################