From 345aab63cf2550646a6a56c2c8fe8473d5bf996a Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Wed, 16 Dec 2020 20:31:10 -0500 Subject: [PATCH] [Round 2] Revert multiple source change commits for re-commit. --- Makefile | 97 +++++++++++++++----------------------- asmdiff.sh | 10 +--- berry_fix/Makefile | 37 ++++++++------- berry_fix/payload/Makefile | 37 ++++++++------- libagbsyscall/Makefile | 37 ++++++++------- map_data_rules.mk | 4 +- tools/aif2pcm/Makefile | 10 +--- tools/bin2c/Makefile | 10 +--- tools/gbafix/Makefile | 10 +--- tools/gbagfx/Makefile | 12 ++--- tools/jsonproc/Makefile | 10 +--- tools/mapjson/Makefile | 10 +--- tools/mid2agb/Makefile | 10 +--- tools/preproc/Makefile | 10 +--- tools/ramscrgen/Makefile | 10 +--- tools/rsfont/Makefile | 10 +--- tools/scaninc/Makefile | 10 +--- 17 files changed, 121 insertions(+), 213 deletions(-) diff --git a/Makefile b/Makefile index 891cab480..78a2c2a4f 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,29 @@ TOOLCHAIN := $(DEVKITARM) COMPARE ?= 0 -# don't use dkP's base_tools anymore -# because the redefinition of $(CC) conflicts -# with when we want to use $(CC) to preprocess files -# thus, manually create the variables for the bin -# files, or use arm-none-eabi binaries on the system -# if dkP is not installed on tihs system +ifeq ($(CC),) +HOSTCC := gcc +else +HOSTCC := $(CC) +endif -ifneq (,$(TOOLCHAIN)) -ifneq ($(wildcard $(TOOLCHAIN)/bin),) +ifeq ($(CXX),) +HOSTCXX := g++ +else +HOSTCXX := $(CXX) +endif + +ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) +include $(TOOLCHAIN)/base_tools +else export PATH := $(TOOLCHAIN)/bin:$(PATH) -endif -endif - PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy -AS := $(PREFIX)as - -ifneq ($(MODERN),1) -CPP := $(CC) -E -else -CPP := $(PREFIX)cpp +export CC := $(PREFIX)gcc +export AS := $(PREFIX)as endif - -LD := $(PREFIX)ld - -# note: the makefile must be set up so MODERNCC is never called -# if MODERN=0 -MODERNCC := $(PREFIX)gcc +export CPP := $(PREFIX)cpp +export LD := $(PREFIX)ld ifeq ($(OS),Windows_NT) EXE := .exe @@ -42,16 +37,6 @@ MAKER_CODE := 01 REVISION := 0 MODERN ?= 0 -ROM_NAME := pokeemerald.gba -ELF_NAME := $(ROM_NAME:.gba=.elf) -MAP_NAME := $(ROM_NAME:.gba=.map) -OBJ_DIR_NAME := build/emerald - -MODERN_ROM_NAME := pokeemerald_modern.gba -MODERN_ELF_NAME := $(MODERN_ROM_NAME:.gba=.elf) -MODERN_MAP_NAME := $(MODERN_ROM_NAME:.gba=.map) -MODERN_OBJ_DIR_NAME := build/modern - SHELL := /bin/bash -o pipefail ELF = $(ROM:.gba=.elf) @@ -79,20 +64,20 @@ ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) ifeq ($(MODERN),0) CC1 := tools/agbcc/bin/agbcc$(EXE) override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -g -ROM := $(ROM_NAME) -OBJ_DIR := $(OBJ_DIR_NAME) +ROM := pokeemerald.gba +OBJ_DIR := build/emerald LIBPATH := -L ../../tools/agbcc/lib else -CC1 = $(shell $(MODERNCC) --print-prog-name=cc1) -quiet +CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -g -ROM := $(MODERN_ROM_NAME) -OBJ_DIR := $(MODERN_OBJ_DIR_NAME) -LIBPATH := -L "$(dir $(shell $(MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(MODERNCC) -mthumb -print-file-name=libc.a))" +ROM := pokeemerald_modern.gba +OBJ_DIR := build/modern +LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))" endif CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) -ifneq ($(MODERN),1) -CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef +ifeq ($(MODERN),0) +CPPFLAGS += -I tools/agbcc/include -I tools/agbcc endif LDFLAGS = -Map ../../$(MAP) @@ -126,7 +111,7 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern tidymodern tidynonmodern +.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) berry_fix libagbsyscall modern infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -177,7 +162,7 @@ all: rom tools: $(TOOLDIRS) $(TOOLDIRS): - @$(MAKE) -C $@ + @$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX) rom: $(ROM) ifeq ($(COMPARE),1) @@ -192,7 +177,7 @@ clean: mostlyclean clean-tools clean-tools: @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) -mostlyclean: tidynonmodern tidymodern +mostlyclean: tidy rm -f $(SAMPLE_SUBDIR)/*.bin rm -f $(CRY_SUBDIR)/*.bin rm -f $(MID_SUBDIR)/*.s @@ -207,15 +192,10 @@ mostlyclean: tidynonmodern tidymodern tidy: rm -f $(ROM) $(ELF) $(MAP) rm -r $(OBJ_DIR) +ifeq ($(MODERN),0) + @$(MAKE) tidy MODERN=1 +endif -tidynonmodern: - rm -f $(ROM_NAME) $(ELF_NAME) $(MAP_NAME) - rm -rf $(OBJ_DIR_NAME) - -tidymodern: - rm -f $(MODERN_ROM_NAME) $(MODERN_ELF_NAME) $(MODERN_MAP_NAME) - rm -rf $(MODERN_OBJ_DIR_NAME) - ifneq ($(MODERN),0) $(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member endif @@ -243,7 +223,7 @@ sound/%.bin: sound/%.aif ; $(AIF) $< $@ ifeq ($(MODERN),0) -$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) +$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc $(C_BUILDDIR)/libc.o: CFLAGS := -O2 $(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork @@ -252,10 +232,10 @@ $(C_BUILDDIR)/agb_flash.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork -$(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) +$(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc $(C_BUILDDIR)/record_mixing.o: CFLAGS += -ffreestanding -$(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm$(EXE) +$(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet else $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast @@ -316,11 +296,11 @@ endif ifeq ($(NODEP),1) $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ + $(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@ else define DATA_ASM_DEP $1: $2 $$(shell $(SCANINC) -I include -I "" $2) - $$(PREPROC) $$< charmap.txt | $$(CPP) -I include - | $$(AS) $$(ASFLAGS) -o $$@ + $$(PREPROC) $$< charmap.txt | $$(CPP) -I include | $$(AS) $$(ASFLAGS) -o $$@ endef $(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src)))) endif @@ -349,8 +329,7 @@ $(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) berry_fix libagbsyscall - @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ " - @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB) + cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB) $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent $(ROM): $(ELF) diff --git a/asmdiff.sh b/asmdiff.sh index f5a701074..6ea588131 100755 --- a/asmdiff.sh +++ b/asmdiff.sh @@ -1,19 +1,11 @@ #!/bin/bash -if [[ -d "$DEVKITARM/bin/" ]]; then - OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" -else - OBJDUMP_BIN="arm-none-eabi-objdump" -fi - -OBJDUMP="$OBJDUMP_BIN -D -bbinary -marmv4t -Mforce-thumb" - +OBJDUMP="$DEVKITARM/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb" if [ $(($1)) -ge $((0x8000000)) ]; then OPTIONS="--adjust-vma=0x8000000 --start-address=$(($1)) --stop-address=$(($1 + $2))" else OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))" fi - $OBJDUMP $OPTIONS baserom.gba > baserom.dump $OBJDUMP $OPTIONS pokeemerald.gba > pokeemerald.dump diff -u baserom.dump pokeemerald.dump diff --git a/berry_fix/Makefile b/berry_fix/Makefile index 8b8d07d42..0ead3804f 100644 --- a/berry_fix/Makefile +++ b/berry_fix/Makefile @@ -1,28 +1,29 @@ TOOLCHAIN := $(DEVKITARM) COMPARE ?= 0 -# don't use dkP's base_tools anymore -# because the redefinition of $(CC) conflicts -# with when we want to use $(CC) to preprocess files -# thus, manually create the variables for the bin -# files, or use arm-none-eabi binaries on the system -# if dkP is not installed on tihs system +ifeq ($(CC),) +HOSTCC := gcc +else +HOSTCC := $(CC) +endif -ifneq (,$(TOOLCHAIN)) -ifneq ($(wildcard $(TOOLCHAIN)/bin),) +ifeq ($(CXX),) +HOSTCXX := g++ +else +HOSTCXX := $(CXX) +endif + +ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) +include $(TOOLCHAIN)/base_tools +else export PATH := $(TOOLCHAIN)/bin:$(PATH) -endif -endif - PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy -AS := $(PREFIX)as -CPP := $(CC) -E -LD := $(PREFIX)ld - -# note: the makefile must be set up so MODERNCC is never called -# if MODERN=0 -MODERNCC := $(PREFIX)gcc +export CC := $(PREFIX)gcc +export AS := $(PREFIX)as +endif +export CPP := $(PREFIX)cpp +export LD := $(PREFIX)ld ifeq ($(OS),Windows_NT) EXE := .exe diff --git a/berry_fix/payload/Makefile b/berry_fix/payload/Makefile index bae657c92..a121fda93 100644 --- a/berry_fix/payload/Makefile +++ b/berry_fix/payload/Makefile @@ -1,28 +1,29 @@ TOOLCHAIN := $(DEVKITARM) COMPARE ?= 0 -# don't use dkP's base_tools anymore -# because the redefinition of $(CC) conflicts -# with when we want to use $(CC) to preprocess files -# thus, manually create the variables for the bin -# files, or use arm-none-eabi binaries on the system -# if dkP is not installed on tihs system +ifeq ($(CC),) +HOSTCC := gcc +else +HOSTCC := $(CC) +endif -ifneq (,$(TOOLCHAIN)) -ifneq ($(wildcard $(TOOLCHAIN)/bin),) +ifeq ($(CXX),) +HOSTCXX := g++ +else +HOSTCXX := $(CXX) +endif + +ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) +include $(TOOLCHAIN)/base_tools +else export PATH := $(TOOLCHAIN)/bin:$(PATH) -endif -endif - PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy -AS := $(PREFIX)as -CPP := $(CC) -E -LD := $(PREFIX)ld - -# note: the makefile must be set up so MODERNCC is never called -# if MODERN=0 -MODERNCC := $(PREFIX)gcc +export CC := $(PREFIX)gcc +export AS := $(PREFIX)as +endif +export CPP := $(PREFIX)cpp +export LD := $(PREFIX)ld ifeq ($(OS),Windows_NT) EXE := .exe diff --git a/libagbsyscall/Makefile b/libagbsyscall/Makefile index 76368da86..911cdb237 100644 --- a/libagbsyscall/Makefile +++ b/libagbsyscall/Makefile @@ -1,28 +1,29 @@ TOOLCHAIN := $(DEVKITARM) COMPARE ?= 0 -# don't use dkP's base_tools anymore -# because the redefinition of $(CC) conflicts -# with when we want to use $(CC) to preprocess files -# thus, manually create the variables for the bin -# files, or use arm-none-eabi binaries on the system -# if dkP is not installed on tihs system +ifeq ($(CC),) +HOSTCC := gcc +else +HOSTCC := $(CC) +endif -ifneq (,$(TOOLCHAIN)) -ifneq ($(wildcard $(TOOLCHAIN)/bin),) +ifeq ($(CXX),) +HOSTCXX := g++ +else +HOSTCXX := $(CXX) +endif + +ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) +include $(TOOLCHAIN)/base_tools +else export PATH := $(TOOLCHAIN)/bin:$(PATH) -endif -endif - PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy -AS := $(PREFIX)as -CPP := $(CC) -E -LD := $(PREFIX)ld - -# note: the makefile must be set up so MODERNCC is never called -# if MODERN=0 -MODERNCC := $(PREFIX)gcc +export CC := $(PREFIX)gcc +export AS := $(PREFIX)as +endif +export CPP := $(PREFIX)cpp +export LD := $(PREFIX)ld ifeq ($(OS),Windows_NT) EXE := .exe diff --git a/map_data_rules.mk b/map_data_rules.mk index 626cd4724..0203b383d 100755 --- a/map_data_rules.mk +++ b/map_data_rules.mk @@ -9,9 +9,9 @@ MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS)) MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS)) $(DATA_ASM_BUILDDIR)/maps.o: $(DATA_ASM_SUBDIR)/maps.s $(LAYOUTS_DIR)/layouts.inc $(LAYOUTS_DIR)/layouts_table.inc $(MAPS_DIR)/headers.inc $(MAPS_DIR)/groups.inc $(MAPS_DIR)/connections.inc $(MAP_CONNECTIONS) $(MAP_HEADERS) - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ + $(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@ $(DATA_ASM_BUILDDIR)/map_events.o: $(DATA_ASM_SUBDIR)/map_events.s $(MAPS_DIR)/events.inc $(MAP_EVENTS) - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ + $(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@ $(MAPS_DIR)/%/header.inc: $(MAPS_DIR)/%/map.json $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json diff --git a/tools/aif2pcm/Makefile b/tools/aif2pcm/Makefile index dd48a8759..77df29152 100644 --- a/tools/aif2pcm/Makefile +++ b/tools/aif2pcm/Makefile @@ -6,18 +6,12 @@ LIBS = -lm SRCS = main.c extended.c -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - .PHONY: all clean -all: aif2pcm$(EXE) +all: aif2pcm @: -aif2pcm$(EXE): $(SRCS) +aif2pcm: $(SRCS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) clean: diff --git a/tools/bin2c/Makefile b/tools/bin2c/Makefile index 4dbfab94f..52806e39c 100644 --- a/tools/bin2c/Makefile +++ b/tools/bin2c/Makefile @@ -6,16 +6,10 @@ CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 SRCS = bin2c.c -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - -all: bin2c$(EXE) +all: bin2c @: -bin2c$(EXE): $(SRCS) +bin2c: $(SRCS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/gbafix/Makefile b/tools/gbafix/Makefile index efb016c97..91a60a9e4 100644 --- a/tools/gbafix/Makefile +++ b/tools/gbafix/Makefile @@ -3,16 +3,10 @@ CC ?= gcc SRCS = gbafix.c -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - -all: gbafix$(EXE) +all: gbafix @: -gbafix$(EXE): $(SRCS) +gbafix: $(SRCS) $(CC) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/gbagfx/Makefile b/tools/gbagfx/Makefile index b4244aa8d..f0638414d 100644 --- a/tools/gbagfx/Makefile +++ b/tools/gbagfx/Makefile @@ -6,21 +6,15 @@ LIBS = -lpng -lz SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - .PHONY: all clean -all: gbagfx$(EXE) +all: gbagfx @: -gbagfx-debug$(EXE): $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h +gbagfx-debug: $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h $(CC) $(CFLAGS) -DDEBUG $(SRCS) -o $@ $(LDFLAGS) $(LIBS) -gbagfx$(EXE): $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h +gbagfx: $(SRCS) convert_png.h gfx.h global.h jasc_pal.h lz.h rl.h util.h font.h $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) clean: diff --git a/tools/jsonproc/Makefile b/tools/jsonproc/Makefile index eec73eb7b..47198b171 100755 --- a/tools/jsonproc/Makefile +++ b/tools/jsonproc/Makefile @@ -8,18 +8,12 @@ SRCS := jsonproc.cpp HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - .PHONY: all clean -all: jsonproc$(EXE) +all: jsonproc @: -jsonproc$(EXE): $(SRCS) $(HEADERS) +jsonproc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/mapjson/Makefile b/tools/mapjson/Makefile index 100e809c6..c1f703f9f 100644 --- a/tools/mapjson/Makefile +++ b/tools/mapjson/Makefile @@ -6,18 +6,12 @@ SRCS := json11.cpp mapjson.cpp HEADERS := mapjson.h -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - .PHONY: all clean -all: mapjson$(EXE) +all: mapjson @: -mapjson$(EXE): $(SRCS) $(HEADERS) +mapjson: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/mid2agb/Makefile b/tools/mid2agb/Makefile index 553b7859e..451d4b39f 100644 --- a/tools/mid2agb/Makefile +++ b/tools/mid2agb/Makefile @@ -6,18 +6,12 @@ SRCS := agb.cpp error.cpp main.cpp midi.cpp tables.cpp HEADERS := agb.h error.h main.h midi.h tables.h -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - .PHONY: all clean -all: mid2agb$(EXE) +all: mid2agb @: -mid2agb$(EXE): $(SRCS) $(HEADERS) +mid2agb: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/preproc/Makefile b/tools/preproc/Makefile index 1507c973f..8c48afea2 100644 --- a/tools/preproc/Makefile +++ b/tools/preproc/Makefile @@ -8,18 +8,12 @@ SRCS := asm_file.cpp c_file.cpp charmap.cpp preproc.cpp string_parser.cpp \ HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \ utf8.h -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - .PHONY: all clean -all: preproc$(EXE) +all: preproc @: -preproc$(EXE): $(SRCS) $(HEADERS) +preproc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/ramscrgen/Makefile b/tools/ramscrgen/Makefile index a9375c87a..4e901a29c 100644 --- a/tools/ramscrgen/Makefile +++ b/tools/ramscrgen/Makefile @@ -8,16 +8,10 @@ HEADERS := ramscrgen.h sym_file.h elf.h char_util.h .PHONY: all clean -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - -all: ramscrgen$(EXE) +all: ramscrgen @: -ramscrgen$(EXE): $(SRCS) $(HEADERS) +ramscrgen: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: diff --git a/tools/rsfont/Makefile b/tools/rsfont/Makefile index 0bc88a42b..930a92b36 100644 --- a/tools/rsfont/Makefile +++ b/tools/rsfont/Makefile @@ -8,16 +8,10 @@ SRCS = main.c convert_png.c util.c font.c .PHONY: all clean -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - -all: rsfont$(EXE) +all: rsfont @: -rsfont$(EXE): $(SRCS) convert_png.h gfx.h global.h util.h font.h +rsfont: $(SRCS) convert_png.h gfx.h global.h util.h font.h $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) clean: diff --git a/tools/scaninc/Makefile b/tools/scaninc/Makefile index 96d92f706..52e663d8d 100644 --- a/tools/scaninc/Makefile +++ b/tools/scaninc/Makefile @@ -8,16 +8,10 @@ HEADERS := scaninc.h asm_file.h c_file.h source_file.h .PHONY: all clean -ifeq ($(OS),Windows_NT) -EXE := .exe -else -EXE := -endif - -all: scaninc$(EXE) +all: scaninc @: -scaninc$(EXE): $(SRCS) $(HEADERS) +scaninc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) clean: