-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (40 loc) · 1.93 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
TOOLCHAIN ?= /home/tavisco/palm/palmdev_V3/buildtools/toolchain/bin
SDK ?= /home/tavisco/palm/palmdev_V3/buildtools/palm-os-sdk-master/sdk-5r3/include
PILRC = /home/tavisco/palm/palmdev_V3/buildtools/pilrc3_3_unofficial/bin/pilrc
CC = $(TOOLCHAIN)/m68k-none-elf-gcc
LD = $(TOOLCHAIN)/m68k-none-elf-gcc
OBJCOPY = $(TOOLCHAIN)/m68k-none-elf-objcopy
COMMON = -Wmissing-prototypes -Wstrict-prototypes -Wall -Wextra -Werror
M68KCOMMON = $(COMMON) -Wno-multichar -funsafe-math-optimizations -Os -m68000 -mno-align-int -mpcrel -fpic -fshort-enums -mshort -fvisibility=hidden -Wno-attributes
WARN = -Wsign-compare -Wextra -Wall -Wno-unused-parameter -Wno-old-style-declaration -Wno-unused-function -Wno-unused-variable -Wno-error=cpp -Wno-switch -Wno-implicit-fallthrough
LKR = linkerPalm68K.lkr
CCFLAGS = $(LTO) $(WARN) $(M68KCOMMON) -I. -ffunction-sections -fdata-sections
LDFLAGS = $(LTO) $(WARN) $(M68KCOMMON) -Wl,--gc-sections -Wl,-T $(LKR)
SRCS = src/uGB.c src/forms/uGBRomSelector.c src/forms/uGBPlayer.c src/forms/uGBKeyBinding.c src/forms/uGBFrameSkipping.c src/forms/uGBDisplayOptions.c
RCP = rsc/uGB.rcp
RSC = src/
OBJS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(SRCS)))
TARGET = uGB
CREATOR = UGB_
TYPE = appl
#add PalmOS SDK
INCS += -isystem$(SDK)
INCS += -isystem$(SDK)/Core
INCS += -isystem$(SDK)/Core/Hardware
INCS += -isystem$(SDK)/Core/System
INCS += -isystem$(SDK)/Core/UI
INCS += -isystem$(SDK)/Dynamic
INCS += -isystem$(SDK)/Libraries
INCS += -isystem$(SDK)/Libraries/PalmOSGlue
INCS += -isystem$(SDK)/Extensions/ExpansionMgr
$(TARGET).prc: code0001.bin
$(PILRC) -ro -o $(TARGET).prc -creator $(CREATOR) -type $(TYPE) -name $(TARGET) -I $(RSC) $(RCP) && rm code0001.bin
%.bin: %.elf
$(OBJCOPY) -O binary $< $@ -j.vec -j.text -j.rodata
%.elf: $(OBJS)
$(LD) -o $@ $(LDFLAGS) $^
%.o : %.c Makefile
$(CC) $(CCFLAGS) $(INCS) -c $< -o $@
clean:
rm -rf $(OBJS) $(NAME).elf $(TARGET).prc
.PHONY: clean