-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.sam
executable file
·75 lines (57 loc) · 2.46 KB
/
Makefile.sam
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# All the o-Files in Link-Order
OBJS_ORDERED = reciter.o sam.o debug.o endian.o sdlwrapper.o portaudio_audev.o render.o render000.o render020.o main.o portaudio_ahidev.o portaudio.o subtask_support.o amiga_version.o stopwatch.o
#COMPILER_INSTALL_DIR = /home/osboxes/opt/m68k-amigaos_23Dec18
COMPILER_INSTALL_DIR ?= $(PREFIX)
COMPILER_DIR = $(COMPILER_INSTALL_DIR)/bin
CC = $(COMPILER_DIR)/m68k-amigaos-gcc #gcc
STRIP = $(COMPILER_DIR)/m68k-amigaos-strip
TOOLCHAIN_VER=$(shell cat $(COMPILER_DIR)/toolchain_commit.txt)
CPUFLAGS=-m68000
CFLAGS = -DDATE="\"$(shell /bin/date +'%d.%m.%Y')\""
CFLAGS += -DPLATFORM_IS_BIG_ENDIAN -DSTATIC_FUNC= -DUSESDL
CFLAGS += -DTOOLCHAIN_VER="\"$(TOOLCHAIN_VER)\""
#CFLAGS += -DDEBUG
CFLAGS += -Iamiga/ -Iamiga/portaudio/ -I. -I$(COMPILER_INSTALL_DIR)/m68k-amigaos/include/SDL
CFLAGS += $(CPUFLAGS)
CFLAGS += -Os # all but render.c arecompiled for size. Only render.c will be compiled for speed
CFLAGS += -Wall -fomit-frame-pointer -noixemul #`sdl-config --cflags`
CFLAGS += -resident
CFLAGS += -msmall-code
LFLAGS = -noixemul $(CPUFLAGS) -Wl,-Map=sam.map,--trace -ldebug #-lSDL #`sdl-config --libs`
LFLAGS += -resident -Xlinker --verbose
#coverage
#CFLAGS += -fprofile-generate=VBox:$(shell pwd | cut -c2-) # remove first "/" from pwd -> VBox:home/...
#CFLAGS += -ftest-coverage
#CFLAGS += -fprofile-arcs #-pg # Profiler
#LFLAGS += -lgcov
#CFLAGS += -g -pg -fno-omit-frame-pointer
#LFLAGS += -pg
vpath sdlwrapper.c src/amiga/
vpath portaudio.c src/amiga/portaudio/
vpath portaudio_ahidev.c src/amiga/portaudio/
vpath portaudio_audev.c src/amiga/portaudio/
vpath portaudio.c src/amiga/portaudio/
vpath subtask_support.c src/amiga/portaudio/
vpath amiga_version.c src/amiga/version/
vpath stopwatch.c src/amiga/stopwatch/
sam: $(OBJS_ORDERED)
$(CC) -o sam $(OBJS_ORDERED) $(LFLAGS)
ls -la sam
sync
strip: sam
$(STRIP) $<
ls -la sam
sync
render000.o: src/render2.c
$(CC) $(CFLAGS) -O2 -c $< -o render000.o # this one is compiled with -O2 as it is the time critical part
render020.o: src/render2.c
$(CC) $(CFLAGS) -m68020 -O2 -c $< -o render020.o # this one is compiled with -O2 as it is the time critical part
%.o: src/%.c
$(CC) $(CFLAGS) -c $<
package:
tar -cvzf sam.tar.gz README.md Makefile sing src/
clean:
rm -f *.o *.wav sam sam.map
archive:
rm -f sam_windows.zip
cd ..; zip SAM/sam_windows.zip SAM/sam.exe SAM/SDL.dll SAM/README.md SAM/demos/*.bat