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 : $(Sbinaryobjects) |
120 |
+ |
$(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) |
121 |
+ |
|
122 |
+ |
# -- Debug Exexcutables |
123 |
+ |
|
124 |
+ |
#LDLIBS_D:=$(shell $(TOOL_HOME)/LibTypeExpand $(LDLIBS) "_d") |
125 |
+ |
%_d.exe : $(Sbinaryobjects) |
126 |
+ |
$(CXX) $(CXXFLAGS) $(CXXDebugFlag) $(LDFLAGS) $< -o $@ \ $(LDLIBS_D) |
127 |
+ |
|
128 |
+ |
realbins:=$(filter $(bintargets),$(notdir $(wildcard $(LOCALTOP)/$(INTbin)/*))) |
129 |
+ |
clean :: |
130 |
+ |
@if [ "$(realbins)" != "" ] ; then \ |
131 |
+ |
echo Removing executables : $(realbins); \ |
132 |
+ |
rm $(LOCALTOP)/$(INTbin)/$(realbins); \ |
133 |
+ |
fi; |
134 |
+ |
|
135 |
+ |
# ------------------------------------------------------------------------- |
136 |
+ |
|
137 |
|
# Some nice generic target names for the user |
138 |
|
|
139 |
|
shared : $(shlibname).$(SharedSuffix) |
160 |
|
# -- Standard Archive Libs |
161 |
|
$(arlibname).$(ArchiveSuffix) : $(Sarchivelibobjs) |
162 |
|
$(ArchiveCCTool) |
163 |
< |
@mv $@ $(librarystore) |
163 |
> |
@mv $@ $(librarystore)/$@ |
164 |
|
|
165 |
|
# -- Debug Archive Libs |
166 |
|
$(arlibname)_d.$(ArchiveSuffix) : $(Sarchivelibdebugobjs) |
167 |
|
$(ArchiveCCTool) |
168 |
< |
@mv $@ $(librarystore) |
168 |
> |
@mv $@ $(librarystore)/$@ |
169 |
|
|
170 |
|
# -- Dependencies |
171 |
|
dependencies.mk: $(files) |