1 |
|
# Some Pre-Defined Rules For Building Stuff |
2 |
|
# |
3 |
< |
include compilers.mk |
3 |
> |
#include compilers.mk |
4 |
|
lib : dependencies.mk |
5 |
|
bin : dependencies.mk |
6 |
|
|
7 |
|
#------------------------------------------------ |
8 |
|
# Default Behaviours - interpreted from makefile |
9 |
|
#------------------------------------------------ |
10 |
+ |
# -- storage of binaries |
11 |
+ |
binarystore:=$(LOCALTOP)/$(INTbin) |
12 |
+ |
VPATH+=:$(LOCALTOP)/$(INTbin):$(RELEASETOP)/$(INTbin) |
13 |
|
|
14 |
|
# -- storage of libraries |
15 |
|
librarystore:=$(LOCALTOP)/$(INTlib) |
60 |
|
Ssharedlibobjs:=$(addsuffix _pic.o,$(sharedfiles)) |
61 |
|
Ssharedlibdebugobjs:=$(addsuffix _picd.o,$(sharedfiles)) |
62 |
|
|
63 |
+ |
# binary target files |
64 |
+ |
Sbinaryobjects:=$(addsuffix .o,$(binfiles)) |
65 |
+ |
|
66 |
|
#------------------------------------------------ |
67 |
|
# Rules Start Here |
68 |
|
#------------------------------------------------ |
114 |
|
%_d.o : %.f |
115 |
|
$(FC) -c $(CPPFLAGS) $(FFLAGS) $(FCDebugFlag) $< -o $@ |
116 |
|
|
117 |
+ |
# ------------------------------------------------------------------------- |
118 |
+ |
# -- Executables |
119 |
+ |
%.exe : %.o |
120 |
+ |
$(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
121 |
+ |
|
122 |
+ |
# -- Debug Exexcutables |
123 |
+ |
|
124 |
+ |
lib_d:=$(shell $(TOOL_HOME)/LibTypeExpand "_d" $(lib)) |
125 |
+ |
LDLIBS_D=$(addprefix -l,$(lib_d)) |
126 |
+ |
|
127 |
+ |
%_d.exe : |
128 |
+ |
$(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ \ $(LDLIBS_D) |
129 |
+ |
|
130 |
+ |
realbins:=$(filter $(bintargets),$(notdir $(wildcard $(LOCALTOP)/$(INTbin)/*))) |
131 |
+ |
clean :: |
132 |
+ |
@if [ "$(realbins)" != "" ] ; then \ |
133 |
+ |
echo Removing executables : $(realbins); \ |
134 |
+ |
rm $(LOCALTOP)/$(INTbin)/$(realbins); \ |
135 |
+ |
fi; |
136 |
+ |
|
137 |
+ |
# ------------------------------------------------------------------------- |
138 |
+ |
|
139 |
|
# Some nice generic target names for the user |
140 |
|
|
141 |
|
shared : $(shlibname).$(SharedSuffix) |
162 |
|
# -- Standard Archive Libs |
163 |
|
$(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs) |
164 |
|
$(ArchiveCCTool) |
165 |
< |
@mv $@ $(librarystore) |
165 |
> |
@mv $@ $(librarystore)/$@ |
166 |
|
|
167 |
|
# -- Debug Archive Libs |
168 |
|
$(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs) |
169 |
|
$(ArchiveCCTool) |
170 |
< |
@mv $@ $(librarystore) |
170 |
> |
@mv $@ $(librarystore)/$@ |
171 |
|
|
172 |
|
# -- Dependencies |
173 |
|
dependencies.mk: $(files) |