|
@@ -158,13 +158,6 @@ $(BIN)/NIC : $(AUTO_DEPS)
|
158
|
158
|
@perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
|
159
|
159
|
CLEANUP += $(BIN)/NIC
|
160
|
160
|
|
161
|
|
-# Library of all objects
|
162
|
|
-#
|
163
|
|
-$(BLIB) : $(BOBJS)
|
164
|
|
- $(AR) r $@ $(BOBJS)
|
165
|
|
- $(RANLIB) $@
|
166
|
|
-blib : $(BLIB)
|
167
|
|
-
|
168
|
161
|
# Analyse a target name (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and
|
169
|
162
|
# derive the variables:
|
170
|
163
|
#
|
|
@@ -232,10 +225,9 @@ TGT_MAKEROM_FLAGS = $(strip $(MAKEROM_FLAGS_$(TGT_ROM_NAME)) \
|
232
|
225
|
# the target.
|
233
|
226
|
#
|
234
|
227
|
COMMA := ,
|
235
|
|
-DEBUG_OBJECTS = $(foreach D,$(subst $(COMMA), ,$(DEBUG)),$(BIN)/$(D).dbg.o)
|
236
|
|
-$(foreach OBJ,$(filter-out $(dbg.o_OBJS),$(DEBUG_OBJECTS)), \
|
237
|
|
- $(error $(OBJ) is not a valid debug object) \
|
238
|
|
-)
|
|
228
|
+DEBUG_OBJS = $(foreach D,$(subst $(COMMA), ,$(DEBUG)),$(BIN)/$(D).dbg.o)
|
|
229
|
+DEBUG_REPLACE_OBJS = $(foreach D,$(subst $(COMMA), ,$(DEBUG)),$(BIN)/$(D).o)
|
|
230
|
+BLIB_OBJS = $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
|
239
|
231
|
|
240
|
232
|
# Print out all derived information for a given target.
|
241
|
233
|
#
|
|
@@ -258,25 +250,33 @@ $(BIN)/%.info :
|
258
|
250
|
@echo
|
259
|
251
|
@echo 'makerom target flags : $(TGT_MAKEROM_FLAGS)'
|
260
|
252
|
@echo
|
261
|
|
- @echo 'Debugging objects : $(DEBUG_OBJECTS)'
|
|
253
|
+ @echo 'Debugging objects : $(DEBUG_OBJS)'
|
|
254
|
+ @echo 'Replaced objects : $(DEBUG_REPLACE_OBJS)'
|
|
255
|
+
|
|
256
|
+# List of objects included in the last build of blib. This is needed
|
|
257
|
+# in order to correctly rebuild blib whenever the list of objects
|
|
258
|
+# changes.
|
|
259
|
+#
|
|
260
|
+BLIB_LIST = $(BIN)/.blib.list
|
|
261
|
+.PHONY : always_check_blib_list
|
|
262
|
+$(BLIB_LIST) : always_check_blib_list
|
|
263
|
+ @[ "$(shell cat $@)" = "$(BLIB_OBJS)" ] || echo "$(BLIB_OBJS)" > $@
|
|
264
|
+.SECONDARY : $(BLIB_LIST)
|
|
265
|
+
|
|
266
|
+# Library of all objects
|
|
267
|
+#
|
|
268
|
+BLIB = $(BIN)/blib.a
|
|
269
|
+$(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
|
|
270
|
+ $(AR) r $@ $(BLIB_OBJS)
|
|
271
|
+ $(RANLIB) $@
|
|
272
|
+blib : $(BLIB)
|
262
|
273
|
|
263
|
274
|
# Build an intermediate object file from the objects required for the
|
264
|
275
|
# specified target.
|
265
|
|
-#
|
266
|
|
-# If it's a debugging version, force a link to take place by making
|
267
|
|
-# this target depend on a phony target, and mark the resulting files
|
268
|
|
-# as being older than BLIB (and prevent them from being deleted), so
|
269
|
|
-# that any subsequent images will do a fresh link. Otherwise, you
|
270
|
|
-# won't get what you expect when you do e.g. "make DEBUG=pci
|
271
|
|
-# bin/pnic.dsk ; make bin/pnic.dsk ; make DEBUG=pci bin/pnic.dsk"
|
272
|
|
-#
|
273
|
|
-$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT) \
|
274
|
|
- $(DEBUG_OBJECTS) $(if $(DEBUG),force_relink)
|
275
|
|
- $(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) \
|
276
|
|
- $(DEBUG_OBJECTS) $(BLIB) -o $@ -Map $(BIN)/$*.tmp.map
|
277
|
|
- $(if $(DEBUG_OBJECTS),$(TOUCH) -r $(BLIB) -B 2 $@ $(BIN)/$*.tmp.map)
|
278
|
|
-.PHONY : force_relink
|
279
|
|
-.SECONDARY :
|
|
276
|
+#
|
|
277
|
+$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
|
|
278
|
+ $(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
|
|
279
|
+ -Map $(BIN)/$*.tmp.map
|
280
|
280
|
|
281
|
281
|
# Show a linker map for the specified target
|
282
|
282
|
#
|