瀏覽代碼

[build] Fix DEBUG builds for filenames with hyphens

Debug builds for filenames with hyphens such as:

     $ make bin/via-rhine.dsk DEBUG=via-rhine

fail with:

     [BUILD] bin/via-rhine.dbg1.o
     <command-line>: error: missing whitespace after the macro name
     make: *** [bin/via-rhine.dbg1.o] Error 1

This is because "-" is not a legal character in C identifiers, and
gcc rejects "-Ddebug_via-rhine=1" as an argument.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
tags/v0.9.9
Joshua Oreman 14 年之前
父節點
當前提交
3fa2779208
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/Makefile.housekeeping

+ 1
- 1
src/Makefile.housekeeping 查看文件

410
 #
410
 #
411
 COMPILE_c	= $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
411
 COMPILE_c	= $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
412
 RULE_c		= $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
412
 RULE_c		= $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
413
-RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(OBJECT)=$* -c $< -o $@ $(POST_O)
413
+RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(subst -,_,$(OBJECT))=$* -c $< -o $@ $(POST_O)
414
 RULE_c_to_c	= $(Q)$(COMPILE_c) -E -c $< > $@
414
 RULE_c_to_c	= $(Q)$(COMPILE_c) -E -c $< > $@
415
 RULE_c_to_s	= $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
415
 RULE_c_to_s	= $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
416
 
416
 

Loading…
取消
儲存