[Round 3] Revert multiple source change commits for re-commit.

This commit is contained in:
luckytyphlosion 2020-12-16 21:24:08 -05:00
parent 32e566def0
commit 5a5acfb0ad
17 changed files with 122 additions and 214 deletions

View File

@ -1,28 +1,29 @@
TOOLCHAIN := $(DEVKITARM) TOOLCHAIN := $(DEVKITARM)
COMPARE ?= 0 COMPARE ?= 0
# don't use dkP's base_tools anymore ifeq ($(CC),)
# because the redefinition of $(CC) conflicts HOSTCC := gcc
# with when we want to use $(CC) to preprocess files else
# thus, manually create the variables for the bin HOSTCC := $(CC)
# files, or use arm-none-eabi binaries on the system endif
# if dkP is not installed on tihs system
ifneq (,$(TOOLCHAIN)) ifeq ($(CXX),)
ifneq ($(wildcard $(TOOLCHAIN)/bin),) HOSTCXX := g++
else
HOSTCXX := $(CXX)
endif
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
else
export PATH := $(TOOLCHAIN)/bin:$(PATH) export PATH := $(TOOLCHAIN)/bin:$(PATH)
endif
endif
PREFIX := arm-none-eabi- PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy OBJCOPY := $(PREFIX)objcopy
AS := $(PREFIX)as export CC := $(PREFIX)gcc
export AS := $(PREFIX)as
LD := $(PREFIX)ld endif
export CPP := $(PREFIX)cpp
# note: the makefile must be set up so MODERNCC is never called export LD := $(PREFIX)ld
# if MODERN=0
MODERNCC := $(PREFIX)gcc
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXE := .exe EXE := .exe
@ -36,22 +37,6 @@ MAKER_CODE := 01
REVISION := 0 REVISION := 0
MODERN ?= 0 MODERN ?= 0
ifneq ($(MODERN),1)
CPP := $(CC) -E
else
CPP := $(PREFIX)cpp
endif
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 SHELL := /bin/bash -o pipefail
ELF = $(ROM:.gba=.elf) ELF = $(ROM:.gba=.elf)
@ -79,20 +64,20 @@ ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN)
ifeq ($(MODERN),0) ifeq ($(MODERN),0)
CC1 := tools/agbcc/bin/agbcc$(EXE) CC1 := tools/agbcc/bin/agbcc$(EXE)
override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -g override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -g
ROM := $(ROM_NAME) ROM := pokeemerald.gba
OBJ_DIR := $(OBJ_DIR_NAME) OBJ_DIR := build/emerald
LIBPATH := -L ../../tools/agbcc/lib LIBPATH := -L ../../tools/agbcc/lib
else 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 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) ROM := pokeemerald_modern.gba
OBJ_DIR := $(MODERN_OBJ_DIR_NAME) OBJ_DIR := build/modern
LIBPATH := -L "$(dir $(shell $(MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(MODERNCC) -mthumb -print-file-name=libc.a))" LIBPATH := -L "$(dir $(shell $(CC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(CC) -mthumb -print-file-name=libc.a))"
endif endif
CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN)
ifneq ($(MODERN),1) ifeq ($(MODERN),0)
CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef CPPFLAGS += -I tools/agbcc/include -I tools/agbcc
endif endif
LDFLAGS = -Map ../../$(MAP) LDFLAGS = -Map ../../$(MAP)
@ -126,7 +111,7 @@ MAKEFLAGS += --no-print-directory
# Secondary expansion is required for dependency variables in object rules. # Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION: .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)))) infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
@ -177,7 +162,7 @@ all: rom
tools: $(TOOLDIRS) tools: $(TOOLDIRS)
$(TOOLDIRS): $(TOOLDIRS):
@$(MAKE) -C $@ @$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX)
rom: $(ROM) rom: $(ROM)
ifeq ($(COMPARE),1) ifeq ($(COMPARE),1)
@ -192,7 +177,7 @@ clean: mostlyclean clean-tools
clean-tools: clean-tools:
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);)
mostlyclean: tidynonmodern tidymodern mostlyclean: tidy
rm -f $(SAMPLE_SUBDIR)/*.bin rm -f $(SAMPLE_SUBDIR)/*.bin
rm -f $(CRY_SUBDIR)/*.bin rm -f $(CRY_SUBDIR)/*.bin
rm -f $(MID_SUBDIR)/*.s rm -f $(MID_SUBDIR)/*.s
@ -207,14 +192,9 @@ mostlyclean: tidynonmodern tidymodern
tidy: tidy:
rm -f $(ROM) $(ELF) $(MAP) rm -f $(ROM) $(ELF) $(MAP)
rm -r $(OBJ_DIR) rm -r $(OBJ_DIR)
ifeq ($(MODERN),0)
tidynonmodern: @$(MAKE) tidy MODERN=1
rm -f $(ROM_NAME) $(ELF_NAME) $(MAP_NAME) endif
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) ifneq ($(MODERN),0)
$(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member $(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member
@ -243,7 +223,7 @@ sound/%.bin: sound/%.aif ; $(AIF) $< $@
ifeq ($(MODERN),0) 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)/libc.o: CFLAGS := -O2
$(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork $(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_1m.o: CFLAGS := -O -mthumb-interwork
$(C_BUILDDIR)/agb_flash_mx.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)/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 $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet
else 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 $(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) ifeq ($(NODEP),1)
$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $(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 else
define DATA_ASM_DEP define DATA_ASM_DEP
$1: $2 $$(shell $(SCANINC) -I include -I "" $2) $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 endef
$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src)))) $(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call DATA_ASM_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src))))
endif 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 cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) berry_fix libagbsyscall $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) berry_fix libagbsyscall
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>" 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 $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
$(ROM): $(ELF) $(ROM): $(ELF)

View File

@ -1,19 +1,11 @@
#!/bin/bash #!/bin/bash
if [[ -d "$DEVKITARM/bin/" ]]; then OBJDUMP="$DEVKITARM/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb"
OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump"
else
OBJDUMP_BIN="arm-none-eabi-objdump"
fi
OBJDUMP="$OBJDUMP_BIN -D -bbinary -marmv4t -Mforce-thumb"
if [ $(($1)) -ge $((0x8000000)) ]; then if [ $(($1)) -ge $((0x8000000)) ]; then
OPTIONS="--adjust-vma=0x8000000 --start-address=$(($1)) --stop-address=$(($1 + $2))" OPTIONS="--adjust-vma=0x8000000 --start-address=$(($1)) --stop-address=$(($1 + $2))"
else else
OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))" OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))"
fi fi
$OBJDUMP $OPTIONS baserom.gba > baserom.dump $OBJDUMP $OPTIONS baserom.gba > baserom.dump
$OBJDUMP $OPTIONS pokeemerald.gba > pokeemerald.dump $OBJDUMP $OPTIONS pokeemerald.gba > pokeemerald.dump
diff -u baserom.dump pokeemerald.dump diff -u baserom.dump pokeemerald.dump

View File

@ -1,28 +1,29 @@
TOOLCHAIN := $(DEVKITARM) TOOLCHAIN := $(DEVKITARM)
COMPARE ?= 0 COMPARE ?= 0
# don't use dkP's base_tools anymore ifeq ($(CC),)
# because the redefinition of $(CC) conflicts HOSTCC := gcc
# with when we want to use $(CC) to preprocess files else
# thus, manually create the variables for the bin HOSTCC := $(CC)
# files, or use arm-none-eabi binaries on the system endif
# if dkP is not installed on tihs system
ifneq (,$(TOOLCHAIN)) ifeq ($(CXX),)
ifneq ($(wildcard $(TOOLCHAIN)/bin),) HOSTCXX := g++
else
HOSTCXX := $(CXX)
endif
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
else
export PATH := $(TOOLCHAIN)/bin:$(PATH) export PATH := $(TOOLCHAIN)/bin:$(PATH)
endif
endif
PREFIX := arm-none-eabi- PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy OBJCOPY := $(PREFIX)objcopy
AS := $(PREFIX)as export CC := $(PREFIX)gcc
CPP := $(CC) -E export AS := $(PREFIX)as
LD := $(PREFIX)ld endif
export CPP := $(PREFIX)cpp
# note: the makefile must be set up so MODERNCC is never called export LD := $(PREFIX)ld
# if MODERN=0
MODERNCC := $(PREFIX)gcc
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXE := .exe EXE := .exe

View File

@ -1,28 +1,29 @@
TOOLCHAIN := $(DEVKITARM) TOOLCHAIN := $(DEVKITARM)
COMPARE ?= 0 COMPARE ?= 0
# don't use dkP's base_tools anymore ifeq ($(CC),)
# because the redefinition of $(CC) conflicts HOSTCC := gcc
# with when we want to use $(CC) to preprocess files else
# thus, manually create the variables for the bin HOSTCC := $(CC)
# files, or use arm-none-eabi binaries on the system endif
# if dkP is not installed on tihs system
ifneq (,$(TOOLCHAIN)) ifeq ($(CXX),)
ifneq ($(wildcard $(TOOLCHAIN)/bin),) HOSTCXX := g++
else
HOSTCXX := $(CXX)
endif
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
else
export PATH := $(TOOLCHAIN)/bin:$(PATH) export PATH := $(TOOLCHAIN)/bin:$(PATH)
endif
endif
PREFIX := arm-none-eabi- PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy OBJCOPY := $(PREFIX)objcopy
AS := $(PREFIX)as export CC := $(PREFIX)gcc
CPP := $(CC) -E export AS := $(PREFIX)as
LD := $(PREFIX)ld endif
export CPP := $(PREFIX)cpp
# note: the makefile must be set up so MODERNCC is never called export LD := $(PREFIX)ld
# if MODERN=0
MODERNCC := $(PREFIX)gcc
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXE := .exe EXE := .exe

View File

@ -1,28 +1,29 @@
TOOLCHAIN := $(DEVKITARM) TOOLCHAIN := $(DEVKITARM)
COMPARE ?= 0 COMPARE ?= 0
# don't use dkP's base_tools anymore ifeq ($(CC),)
# because the redefinition of $(CC) conflicts HOSTCC := gcc
# with when we want to use $(CC) to preprocess files else
# thus, manually create the variables for the bin HOSTCC := $(CC)
# files, or use arm-none-eabi binaries on the system endif
# if dkP is not installed on tihs system
ifneq (,$(TOOLCHAIN)) ifeq ($(CXX),)
ifneq ($(wildcard $(TOOLCHAIN)/bin),) HOSTCXX := g++
else
HOSTCXX := $(CXX)
endif
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
else
export PATH := $(TOOLCHAIN)/bin:$(PATH) export PATH := $(TOOLCHAIN)/bin:$(PATH)
endif
endif
PREFIX := arm-none-eabi- PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy OBJCOPY := $(PREFIX)objcopy
AS := $(PREFIX)as export CC := $(PREFIX)gcc
CPP := $(CC) -E export AS := $(PREFIX)as
LD := $(PREFIX)ld endif
export CPP := $(PREFIX)cpp
# note: the makefile must be set up so MODERNCC is never called export LD := $(PREFIX)ld
# if MODERN=0
MODERNCC := $(PREFIX)gcc
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
EXE := .exe EXE := .exe

View File

@ -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)) 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) $(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) $(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 $(MAPS_DIR)/%/header.inc: $(MAPS_DIR)/%/map.json
$(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json

View File

@ -6,18 +6,12 @@ LIBS = -lm
SRCS = main.c extended.c SRCS = main.c extended.c
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: aif2pcm$(EXE) all: aif2pcm
@: @:
aif2pcm$(EXE): $(SRCS) aif2pcm: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
clean: clean:

View File

@ -6,16 +6,10 @@ CFLAGS = -Wall -Wextra -Werror -std=c11 -O2
SRCS = bin2c.c SRCS = bin2c.c
ifeq ($(OS),Windows_NT) all: bin2c
EXE := .exe
else
EXE :=
endif
all: bin2c$(EXE)
@: @:
bin2c$(EXE): $(SRCS) bin2c: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -3,16 +3,10 @@ CC ?= gcc
SRCS = gbafix.c SRCS = gbafix.c
ifeq ($(OS),Windows_NT) all: gbafix
EXE := .exe
else
EXE :=
endif
all: gbafix$(EXE)
@: @:
gbafix$(EXE): $(SRCS) gbafix: $(SRCS)
$(CC) $(SRCS) -o $@ $(LDFLAGS) $(CC) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -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 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 .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) $(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) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
clean: clean:

View File

@ -8,18 +8,12 @@ SRCS := jsonproc.cpp
HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: jsonproc$(EXE) all: jsonproc
@: @:
jsonproc$(EXE): $(SRCS) $(HEADERS) jsonproc: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -6,18 +6,12 @@ SRCS := json11.cpp mapjson.cpp
HEADERS := mapjson.h HEADERS := mapjson.h
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: mapjson$(EXE) all: mapjson
@: @:
mapjson$(EXE): $(SRCS) $(HEADERS) mapjson: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -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 HEADERS := agb.h error.h main.h midi.h tables.h
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: mid2agb$(EXE) all: mid2agb
@: @:
mid2agb$(EXE): $(SRCS) $(HEADERS) mid2agb: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -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 \ HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \
utf8.h utf8.h
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
.PHONY: all clean .PHONY: all clean
all: preproc$(EXE) all: preproc
@: @:
preproc$(EXE): $(SRCS) $(HEADERS) preproc: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -8,16 +8,10 @@ HEADERS := ramscrgen.h sym_file.h elf.h char_util.h
.PHONY: all clean .PHONY: all clean
ifeq ($(OS),Windows_NT) all: ramscrgen
EXE := .exe
else
EXE :=
endif
all: ramscrgen$(EXE)
@: @:
ramscrgen$(EXE): $(SRCS) $(HEADERS) ramscrgen: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean:

View File

@ -8,16 +8,10 @@ SRCS = main.c convert_png.c util.c font.c
.PHONY: all clean .PHONY: all clean
ifeq ($(OS),Windows_NT) all: rsfont
EXE := .exe
else
EXE :=
endif
all: rsfont$(EXE)
@: @:
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) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)
clean: clean:

View File

@ -8,16 +8,10 @@ HEADERS := scaninc.h asm_file.h c_file.h source_file.h
.PHONY: all clean .PHONY: all clean
ifeq ($(OS),Windows_NT) all: scaninc
EXE := .exe
else
EXE :=
endif
all: scaninc$(EXE)
@: @:
scaninc$(EXE): $(SRCS) $(HEADERS) scaninc: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)
clean: clean: