Other minor makefile stuff

This commit is contained in:
Aurora 2016-09-23 18:45:59 +02:00
parent d46beac22a
commit 2dd1baebb3
4 changed files with 12 additions and 8 deletions

View File

@ -15,6 +15,7 @@ name := arm11_exceptions
dir_source := source dir_source := source
dir_build := build dir_build := build
dir_out := ../../$(dir_build)
ASFLAGS := -mcpu=mpcore -mfpu=vfp ASFLAGS := -mcpu=mpcore -mfpu=vfp
CFLAGS := -Wall -Wextra -MMD -MP -mthumb -mthumb-interwork $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math CFLAGS := -Wall -Wextra -MMD -MP -mthumb -mthumb-interwork $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
@ -25,13 +26,13 @@ objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
$(call rwildcard, $(dir_source), *.s *.c))) $(call rwildcard, $(dir_source), *.s *.c)))
.PHONY: all .PHONY: all
all: ../../$(dir_build)/$(name).bin all: $(dir_out)/$(name).bin
.PHONY: clean .PHONY: clean
clean: clean:
@rm -rf $(dir_build) @rm -rf $(dir_build)
../../$(dir_build)/$(name).bin: $(dir_build)/$(name).elf $(dir_out)/$(name).bin: $(dir_build)/$(name).elf
$(OC) -S -O binary $< $@ $(OC) -S -O binary $< $@
$(dir_build)/$(name).elf: $(objects) $(dir_build)/$(name).elf: $(objects)

View File

@ -15,6 +15,7 @@ name := arm9_exceptions
dir_source := source dir_source := source
dir_build := build dir_build := build
dir_out := ../../$(dir_build)
ASFLAGS := -mcpu=arm946e-s ASFLAGS := -mcpu=arm946e-s
CFLAGS := -Wall -Wextra -MMD -MP -mthumb -mthumb-interwork $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math CFLAGS := -Wall -Wextra -MMD -MP -mthumb -mthumb-interwork $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
@ -25,13 +26,13 @@ objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
$(call rwildcard, $(dir_source), *.s *.c))) $(call rwildcard, $(dir_source), *.s *.c)))
.PHONY: all .PHONY: all
all: ../../$(dir_build)/$(name).bin all: $(dir_out)/$(name).bin
.PHONY: clean .PHONY: clean
clean: clean:
@rm -rf $(dir_build) @rm -rf $(dir_build)
../../$(dir_build)/$(name).bin: $(dir_build)/$(name).elf $(dir_out)/$(name).bin: $(dir_build)/$(name).elf
$(OC) -S -O binary $< $@ $(OC) -S -O binary $< $@
$(dir_build)/$(name).elf: $(objects) $(dir_build)/$(name).elf: $(objects)

View File

@ -15,6 +15,7 @@ name := $(shell basename $(CURDIR))
dir_source := source dir_source := source
dir_build := build dir_build := build
dir_out := ../$(dir_build)
LIBS := -lctru LIBS := -lctru
LIBDIRS := $(CTRULIB) LIBDIRS := $(CTRULIB)
@ -31,13 +32,13 @@ objects = $(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
$(call rwildcard, $(dir_source), *.s *.c)) $(call rwildcard, $(dir_source), *.s *.c))
.PHONY: all .PHONY: all
all: ../$(dir_build)/$(name).bin all: $(dir_out)/$(name).bin
.PHONY: clean .PHONY: clean
clean: clean:
@rm -rf $(dir_build) @rm -rf $(dir_build)
../$(dir_build)/$(name).bin: $(dir_build)/$(name).elf $(dir_out)/$(name).bin: $(dir_build)/$(name).elf
@makerom -f ncch -rsf loader.rsf -nocodepadding -o $@ -elf $< @makerom -f ncch -rsf loader.rsf -nocodepadding -o $@ -elf $<
$(dir_build)/$(name).elf: $(objects) $(dir_build)/$(name).elf: $(objects)

View File

@ -15,6 +15,7 @@ name := $(shell basename $(CURDIR))
dir_source := source dir_source := source
dir_build := build dir_build := build
dir_out := ../$(dir_build)
ASFLAGS := -mcpu=arm946e-s ASFLAGS := -mcpu=arm946e-s
CFLAGS := -Wall -Wextra -MMD -MP -mthumb -mthumb-interwork $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math CFLAGS := -Wall -Wextra -MMD -MP -mthumb -mthumb-interwork $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
@ -25,13 +26,13 @@ objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
$(call rwildcard, $(dir_source), *.s *.c))) $(call rwildcard, $(dir_source), *.s *.c)))
.PHONY: all .PHONY: all
all: ../$(dir_build)/$(name).bin all: $(dir_out)/$(name).bin
.PHONY: clean .PHONY: clean
clean: clean:
@rm -rf $(dir_build) @rm -rf $(dir_build)
../$(dir_build)/$(name).bin: $(dir_build)/$(name).elf $(dir_out)/$(name).bin: $(dir_build)/$(name).elf
$(OC) -S -O binary $< $@ $(OC) -S -O binary $< $@
$(dir_build)/$(name).elf: $(objects) $(dir_build)/$(name).elf: $(objects)