forked from EXL/P2kElfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.mcore
49 lines (41 loc) · 1.76 KB
/
Makefile.mcore
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
48
49
# This Makefile was created by EXL, 25-Apr-2024.
# Default platform is Motorola P2K M-CORE, ElfPack v2.0 for M-CORE, `mcore-elf-gcc-3.4.6` on Linux.
# Compiler path.
MCORE_PATH = /opt/mcore-elf-gcc
# SDK path.
SDK_PATH = $(MCORE_PATH)/sdk
# Libraries path.
LIB_PATH = $(MCORE_PATH)/mcore-elf/lib
# Defines.
DEFINES = -D__P2K__ -DEM2 -DROT_0 -DFPS_30 -DVIEWPORT_WIDTH=176 -DVIEWPORT_HEIGHT=220
#DEFINES = -D__P2K__ -DEM2 -DROT_0 -DFPS_30 -DVIEWPORT_WIDTH=240 -DVIEWPORT_HEIGHT=320
# Optimization.
OPTIM = -O2
# Project/ELF name.
ELF_NAME = Yeti3D
all:
$(MCORE_PATH)/bin/mcore-elf-gcc -fshort-wchar -funsigned-char -fomit-frame-pointer -fno-builtin \
-m340 -m4align -mbig-endian -nostdinc -nostdlib \
-I$(SDK_PATH) $(INCLUDES) $(DEFINES) $(OPTIM) \
-c data.c -o data.o
$(MCORE_PATH)/bin/mcore-elf-gcc -fshort-wchar -funsigned-char -fomit-frame-pointer -fno-builtin \
-m340 -m4align -mbig-endian -nostdinc -nostdlib \
-I$(SDK_PATH) $(INCLUDES) $(DEFINES) $(OPTIM) \
-c draw.c -o draw.o
$(MCORE_PATH)/bin/mcore-elf-gcc -fshort-wchar -funsigned-char -fomit-frame-pointer -fno-builtin \
-m340 -m4align -mbig-endian -nostdinc -nostdlib \
-I$(SDK_PATH) $(INCLUDES) $(DEFINES) $(OPTIM) \
-c yeti.c -o yeti.o
$(MCORE_PATH)/bin/mcore-elf-gcc -fshort-wchar -funsigned-char -fomit-frame-pointer -fno-builtin \
-m340 -m4align -mbig-endian -nostdinc -nostdlib \
-I$(SDK_PATH) $(INCLUDES) $(DEFINES) $(OPTIM) \
-c $(ELF_NAME).c -o $(ELF_NAME).o
$(MCORE_PATH)/bin/mcore-elf-ld -d -EB -N -r -s -Bstatic -Bsymbolic -Bsymbolic-functions \
-nostdinc -nostdlib --unresolved-symbols=report-all -z muldefs -z combreloc -z nodefaultlib \
data.o draw.o yeti.o $(ELF_NAME).o \
-T$(LIB_PATH)/linker_elf.ld -o $(ELF_NAME).elf
clean:
-rm -f *.o
-rm -f *.obj
-rm -f *.elfp
-rm -f *.elf