Browse Source

Cope with builds with differing debug options within a second of each

other.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
fc5f6c9de2
1 changed files with 8 additions and 15 deletions
  1. 8
    15
      src/Makefile.housekeeping

+ 8
- 15
src/Makefile.housekeeping View File

237
 # the target.
237
 # the target.
238
 #
238
 #
239
 COMMA		:= ,
239
 COMMA		:= ,
240
+SPACE		:= $(subst x, ,x)
240
 DEBUG_LIST	= $(subst $(COMMA), ,$(DEBUG))
241
 DEBUG_LIST	= $(subst $(COMMA), ,$(DEBUG))
241
 DEBUG_OBJ_LEVEL	= $(firstword $(word 2,$(subst :, ,$(1))) 1)
242
 DEBUG_OBJ_LEVEL	= $(firstword $(word 2,$(subst :, ,$(1))) 1)
242
 DEBUG_OBJ_BASE	= $(word 1,$(subst :, ,$(1))).dbg$(call DEBUG_OBJ_LEVEL,$(1))
243
 DEBUG_OBJ_BASE	= $(word 1,$(subst :, ,$(1))).dbg$(call DEBUG_OBJ_LEVEL,$(1))
245
 DEBUG_OBJS	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))
246
 DEBUG_OBJS	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))
246
 DEBUG_ORIG_OBJS	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_ORIG_OBJ,$(D)))
247
 DEBUG_ORIG_OBJS	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_ORIG_OBJ,$(D)))
247
 BLIB_OBJS	= $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
248
 BLIB_OBJS	= $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
249
+BLIB_TAG_ELEM	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ_BASE,$(D)))
250
+BLIB_TAG	= $(subst $(SPACE),-,$(strip blib $(sort $(BLIB_TAG_ELEM))))
248
 
251
 
249
 # Print out all derived information for a given target.
252
 # Print out all derived information for a given target.
250
 #
253
 #
268
 	@echo
271
 	@echo
269
 	@echo 'Debugging objects    : $(DEBUG_OBJS)'
272
 	@echo 'Debugging objects    : $(DEBUG_OBJS)'
270
 	@echo 'Replaced objects     : $(DEBUG_ORIG_OBJS)'
273
 	@echo 'Replaced objects     : $(DEBUG_ORIG_OBJS)'
271
-
272
-# List of objects included in the last build of blib.  This is needed
273
-# in order to correctly rebuild blib whenever the list of objects
274
-# changes.
275
-#
276
-BLIB_LIST	= $(BIN)/.blib.list
277
-ifneq ($(shell cat $(BLIB_LIST)),$(BLIB_OBJS))
278
-$(shell echo "$(BLIB_OBJS)" > $(BLIB_LIST))
279
-endif
280
-
281
-$(BLIB_LIST) :
282
-
283
-VERYCLEANUP	+= $(BLIB_LIST)
274
+	@echo 'Build library tag    : $(BLIB_TAG)'
284
 
275
 
285
 # Library of all objects
276
 # Library of all objects
286
 #
277
 #
287
-BLIB		= $(BIN)/blib.a
288
-$(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
278
+BLIB		= $(BIN)/$(BLIB_TAG).a
279
+$(BLIB) : $(BLIB_OBJS) $(MAKEDEPS)
289
 	$(Q)$(RM) $(BLIB)
280
 	$(Q)$(RM) $(BLIB)
290
 	$(QM)echo "  [AR] $@"
281
 	$(QM)echo "  [AR] $@"
291
 	$(Q)$(AR) r $@ $(BLIB_OBJS)
282
 	$(Q)$(AR) r $@ $(BLIB_OBJS)
430
 $(SYMTAB) : $(BLIB)
421
 $(SYMTAB) : $(BLIB)
431
 	$(NM) -o -S $< > $@
422
 	$(NM) -o -S $< > $@
432
 
423
 
424
+CLEANUP += $(BIN)/symtab
425
+
433
 symcheck : $(SYMTAB)
426
 symcheck : $(SYMTAB)
434
 	$(SYMCHECK) $<
427
 	$(SYMCHECK) $<
435
 
428
 

Loading…
Cancel
Save