Makefile cleanup
This commit is contained in:
parent
0d25c07333
commit
ab8507e09d
3
Makefile
3
Makefile
@ -22,7 +22,7 @@ dir_build := build
|
|||||||
dir_out := out
|
dir_out := out
|
||||||
|
|
||||||
ASFLAGS := -mcpu=arm946e-s
|
ASFLAGS := -mcpu=arm946e-s
|
||||||
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -flto -ffast-math
|
CFLAGS := -Wall -Wextra $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
|
||||||
LDFLAGS := -nostartfiles
|
LDFLAGS := -nostartfiles
|
||||||
|
|
||||||
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
||||||
@ -106,4 +106,3 @@ $(dir_build)/%.o: $(dir_source)/%.c $(bundled)
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
|
||||||
|
@ -4,12 +4,7 @@ ifeq ($(strip $(DEVKITARM)),)
|
|||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(DEVKITARM)/3ds_rules
|
include $(DEVKITARM)/base_tools
|
||||||
|
|
||||||
CC := arm-none-eabi-gcc
|
|
||||||
AS := arm-none-eabi-as
|
|
||||||
LD := arm-none-eabi-ld
|
|
||||||
OC := arm-none-eabi-objcopy
|
|
||||||
|
|
||||||
name := arm11_exceptions
|
name := arm11_exceptions
|
||||||
|
|
||||||
@ -18,7 +13,7 @@ dir_build := build
|
|||||||
dir_out := ../../$(dir_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 $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
|
||||||
LDFLAGS := -nostdlib
|
LDFLAGS := -nostdlib
|
||||||
|
|
||||||
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
||||||
@ -33,7 +28,7 @@ clean:
|
|||||||
@rm -rf $(dir_build)
|
@rm -rf $(dir_build)
|
||||||
|
|
||||||
$(dir_out)/$(name).bin: $(dir_build)/$(name).elf
|
$(dir_out)/$(name).bin: $(dir_build)/$(name).elf
|
||||||
$(OC) -S -O binary $< $@
|
$(OBJCOPY) -S -O binary $< $@
|
||||||
|
|
||||||
$(dir_build)/$(name).elf: $(objects)
|
$(dir_build)/$(name).elf: $(objects)
|
||||||
$(CC) $(LDFLAGS) -T linker.ld $(OUTPUT_OPTION) $^
|
$(CC) $(LDFLAGS) -T linker.ld $(OUTPUT_OPTION) $^
|
||||||
@ -45,4 +40,3 @@ $(dir_build)/%.o: $(dir_source)/%.c
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
|
||||||
|
@ -4,12 +4,7 @@ ifeq ($(strip $(DEVKITARM)),)
|
|||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(DEVKITARM)/3ds_rules
|
include $(DEVKITARM)/base_tools
|
||||||
|
|
||||||
CC := arm-none-eabi-gcc
|
|
||||||
AS := arm-none-eabi-as
|
|
||||||
LD := arm-none-eabi-ld
|
|
||||||
OC := arm-none-eabi-objcopy
|
|
||||||
|
|
||||||
name := arm9_exceptions
|
name := arm9_exceptions
|
||||||
|
|
||||||
@ -18,7 +13,7 @@ dir_build := build
|
|||||||
dir_out := ../../$(dir_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 -mthumb $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
|
||||||
LDFLAGS := -nostdlib
|
LDFLAGS := -nostdlib
|
||||||
|
|
||||||
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
||||||
@ -33,7 +28,7 @@ clean:
|
|||||||
@rm -rf $(dir_build)
|
@rm -rf $(dir_build)
|
||||||
|
|
||||||
$(dir_out)/$(name).bin: $(dir_build)/$(name).elf
|
$(dir_out)/$(name).bin: $(dir_build)/$(name).elf
|
||||||
$(OC) -S -O binary $< $@
|
$(OBJCOPY) -S -O binary $< $@
|
||||||
|
|
||||||
$(dir_build)/$(name).elf: $(objects)
|
$(dir_build)/$(name).elf: $(objects)
|
||||||
$(CC) $(LDFLAGS) -T linker.ld $(OUTPUT_OPTION) $^
|
$(CC) $(LDFLAGS) -T linker.ld $(OUTPUT_OPTION) $^
|
||||||
@ -45,4 +40,3 @@ $(dir_build)/%.o: $(dir_source)/%.c
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
|
||||||
|
@ -15,7 +15,7 @@ dir_build := build
|
|||||||
dir_out := ../out
|
dir_out := ../out
|
||||||
|
|
||||||
ASFLAGS := -mcpu=arm946e-s
|
ASFLAGS := -mcpu=arm946e-s
|
||||||
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -flto -ffast-math
|
CFLAGS := -Wall -Wextra $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
|
||||||
LDFLAGS := -nostartfiles
|
LDFLAGS := -nostartfiles
|
||||||
FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-friendly 3DS CFW." APP_AUTHOR="Aurora Wright/TuxSH" --no-print-directory
|
FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-friendly 3DS CFW." APP_AUTHOR="Aurora Wright/TuxSH" --no-print-directory
|
||||||
ROPFLAGS := DATNAME=$(name).dat DISPNAME=$(name) GRAPHICS=../graphics/
|
ROPFLAGS := DATNAME=$(name).dat DISPNAME=$(name) GRAPHICS=../graphics/
|
||||||
@ -72,4 +72,3 @@ $(dir_build)/%.o: $(dir_source)/%.c $(bundled)
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
|
||||||
|
@ -19,9 +19,8 @@ LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
|||||||
|
|
||||||
INCLUDE := $(foreach dir,$(LIBDIRS),-I$(dir)/include)
|
INCLUDE := $(foreach dir,$(LIBDIRS),-I$(dir)/include)
|
||||||
|
|
||||||
ASFLAGS := -mcpu=mpcore -mfloat-abi=hard -mtp=soft
|
ASFLAGS := -mcpu=mpcore -mfloat-abi=hard
|
||||||
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -std=c11 -O2 -flto -ffast-math -mword-relocations \
|
CFLAGS := -Wall -Wextra $(ASFLAGS) -fno-builtin -std=c11 -O2 -flto -ffast-math $(INCLUDE) -DARM11 -D_3DS
|
||||||
-ffunction-sections -fdata-sections $(INCLUDE) -DARM11 -D_3DS
|
|
||||||
LDFLAGS := -Xlinker --defsym="__start__=0x14000000" -specs=3dsx.specs $(ASFLAGS)
|
LDFLAGS := -Xlinker --defsym="__start__=0x14000000" -specs=3dsx.specs $(ASFLAGS)
|
||||||
|
|
||||||
objects = $(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
|
objects = $(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
|
||||||
@ -68,4 +67,3 @@ $(dir_build)/%.o: $(dir_source)/%.c
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
|
||||||
|
@ -13,7 +13,7 @@ dir_build := build
|
|||||||
dir_out := ../$(dir_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 -mthumb $(ASFLAGS) -fno-builtin -std=c11 -Wno-main -O2 -flto -ffast-math
|
||||||
LDFLAGS := -nostdlib
|
LDFLAGS := -nostdlib
|
||||||
|
|
||||||
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
||||||
@ -42,4 +42,3 @@ $(dir_build)/%.o: $(dir_source)/%.c
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
|
||||||
|
Reference in New Issue
Block a user