1 |
williamc |
1.2 |
# library build rules
|
2 |
|
|
# Control Variables
|
3 |
|
|
# -----------------
|
4 |
|
|
# files
|
5 |
|
|
# libname
|
6 |
|
|
# SharedSuffix
|
7 |
|
|
# ArchiveSuffix
|
8 |
|
|
|
9 |
|
|
# ------ <Build> targets ----
|
10 |
|
|
libname=buildname
|
11 |
|
|
ifneq ($(strip $(files)),)
|
12 |
|
|
lib_%:: dependencies.mk libmsg
|
13 |
|
|
lib_archive:: $(libname).$(ArchiveSuffix)
|
14 |
|
|
lib_archive_debug:: $(libname)_d.$(ArchiveSuffix)
|
15 |
|
|
lib_archive_insure:: $(libname)_insure.$(ArchiveSuffix)
|
16 |
|
|
lib_shared:: $(libname).$(SharedSuffix)
|
17 |
|
|
lib_shared_debug :: $(libname)_d.$(SharedSuffix)
|
18 |
|
|
lib_shared_insure :: $(libname)_insure.$(SharedSuffix)
|
19 |
|
|
endif
|
20 |
|
|
|
21 |
|
|
include $(TOOL_HOME)/BuildSystem/objectfiles.mk
|
22 |
|
|
|
23 |
|
|
# -- Set the library vpaths
|
24 |
|
|
vpath %.$(SharedSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
|
25 |
|
|
vpath %.$(ArchiveSuffix) $(librarystore):$(RELEASETOP)/$(INTlib)
|
26 |
|
|
|
27 |
|
|
.PHONY: libmsg
|
28 |
|
|
libmsg::
|
29 |
|
|
@echo --------------- $(libname) --------------
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
#------------------------------------------------
|
33 |
|
|
# Set up some system variables
|
34 |
|
|
# - all begin with S
|
35 |
|
|
#------------------------------------------------
|
36 |
|
|
|
37 |
|
|
Sarchivelibobjs:=$(addsuffix _o.o,$(archivefiles))
|
38 |
|
|
Sarchivelibdebugobjs:=$(addsuffix _d.o,$(archivefiles))
|
39 |
|
|
Ssharedlibobjs:=$(addsuffix _pic.o,$(sharedfiles))
|
40 |
|
|
Ssharedlibdebugobjs:=$(addsuffix _picd.o,$(sharedfiles))
|
41 |
|
|
SsharedlibInsureobjs:=$(addsuffix _picInsure.o,$(sharedfiles))
|
42 |
|
|
SarchivelibInsureobjs:=$(addsuffix _Insure.o,$(archivefiles))
|
43 |
|
|
|
44 |
|
|
# Now more specific rules
|
45 |
|
|
|
46 |
|
|
# -- Standard Shared Objects Libs
|
47 |
|
|
$(shlibname).$(SharedSuffix) : $(Ssharedlibobjs)
|
48 |
|
|
$(SharedCCTool)
|
49 |
|
|
@$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp $@.ds $@ $^
|
50 |
|
|
@mv $@ $(librarystore)/$@
|
51 |
|
|
|
52 |
|
|
# -- Debug Shared Objects Libs
|
53 |
|
|
$(shlibname)_d.$(SharedSuffix) : $(Ssharedlibdebugobjs)
|
54 |
|
|
$(DebugSharedCCTool)
|
55 |
|
|
@$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp $@.ds $@ $^
|
56 |
|
|
@mv $@ $(librarystore)/$@
|
57 |
|
|
|
58 |
|
|
# -- Insure Shared Objects Libs
|
59 |
|
|
$(shlibname)_Insure.$(SharedSuffix) : $(SsharedlibInsureobjs)
|
60 |
|
|
$(InsureSharedCCTool)
|
61 |
|
|
@$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp $@.ds $@ $^
|
62 |
|
|
@mv $@ $(librarystore)/$@
|
63 |
|
|
|
64 |
|
|
# -- Standard Archive Libs
|
65 |
|
|
$(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs)
|
66 |
|
|
$(ArchiveCCTool)
|
67 |
|
|
@$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp $@.ds $@ $^
|
68 |
|
|
@mv $@ $(librarystore)/$@
|
69 |
|
|
|
70 |
|
|
# -- Debug Archive Libs
|
71 |
|
|
$(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs)
|
72 |
|
|
$(DebugArchiveCCTool)
|
73 |
|
|
@$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp $@.ds $@ $^
|
74 |
|
|
@mv $@ $(librarystore)/$@
|
75 |
|
|
|
76 |
|
|
# -- Insure Archive libs
|
77 |
|
|
$(arlibname)_Insure.$(ArchiveSuffix) : $(SarchivelibInsureobjs)
|
78 |
|
|
$(DebugArchiveCCTool)
|
79 |
|
|
@$(SCRAMPERL) $(SCRAM_HOME)/src/scramdatestamp $@.ds $@ $^
|
80 |
|
|
@mv $@ $(librarystore)/$@
|
81 |
|
|
|
82 |
|
|
# -- Dependencies
|
83 |
|
|
ifndef MAKETARGET_clean
|
84 |
|
|
dependencies.mk:: $(files)
|
85 |
|
|
@if [ "$<" != "" ]; then \
|
86 |
|
|
echo Generating Dependencies; \
|
87 |
|
|
$(DependencyCCTool); \
|
88 |
|
|
$(SCRAMPERL) $(TOOL_HOME)/DependencyMangler $@; \
|
89 |
|
|
fi
|
90 |
|
|
|
91 |
|
|
endif
|