-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (25 loc) · 959 Bytes
/
Makefile
File metadata and controls
36 lines (25 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
################################
# Build relaunch from assembly #
################################
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
export TARGET := $(shell basename $(CURDIR))
export TOPDIR := $(CURDIR)
include $(DEVKITARM)/base_rules
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
$(ARMELF) : $(OFILES)
@echo linking $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
all: title.tmd
relaunch.elf: relaunch.s
mkdir -p $(dir $@)
$(PREFIX)gcc -nostartfiles -nostdlib -Wa,--strip-local-absolute -Wa,-alhns -T tmd.ld -o relaunch.elf relaunch.s > relaunch.lst
title.tmd: relaunch.elf
$(PREFIX)objcopy -v -O binary -j .text relaunch.elf title.tmd
clean:
rm -f *.elf
rm -f *.o
rm -f title.tmd