forked from libsdl-org/SDL
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.amigaos4
146 lines (121 loc) · 3.88 KB
/
Makefile.amigaos4
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Makefile to build the AmigaOS4 SDL library
AR = ppc-amigaos-ar
RANLIB = ppc-amigaos-ranlib
CC = ppc-amigaos-gcc
CXX = ppc-amigaos-g++
STRIP = ppc-amigaos-strip
CRT ?= newlib
INSTALL_PATH ?=
CATCOMP = catcomp # TODO: is there a cross-compiler version?
AMIGADATE = $(shell date +"%-d.%m.%Y")
CFLAGS = -mcrt=$(CRT) -gstabs -O2 -Wall -Werror -Wshadow -fPIC -fcommon -I./include -I./include/build_config -I./include/SDL3 -I./src -D__AMIGADATE__=\"$(AMIGADATE)\"
TARGET_STATIC = libSDL3.a
TARGET_SHARED = libSDL3-3.0.so
TESTLIB_STATIC = libSDL3_test.a
PREFS_PROGRAM = SDL3
SOURCES = \
./src/*.c \
./src/atomic/*.c \
./src/audio/*.c \
./src/audio/amigaos4/*.c \
./src/audio/dummy/*.c \
./src/camera/*.c \
./src/cpuinfo/*.c \
./src/dialog/amigaos4/SDL_amigaos4dialog.c \
./src/events/*.c \
./src/file/*.c \
./src/filesystem/SDL_filesystem.c \
./src/filesystem/amigaos4/*.c \
./src/haptic/*.c \
./src/haptic/dummy/*.c \
./src/joystick/*.c \
./src/joystick/amigaos4/*.c \
./src/joystick/virtual/*.c \
./src/libm/*.c \
./src/loadso/amigaos4/*.c \
./src/locale/*.c \
./src/locale/amigaos4/*.c \
./src/main/generic/SDL_sysmain_callbacks.c \
./src/main/SDL_main_callbacks.c \
./src/misc/*.c \
./src/misc/amigaos4/*.c \
./src/render/*.c \
./src/power/*.c \
./src/process/*.c \
./src/process/amigaos4/*.c \
./src/render/amigaos4/*.c \
./src/render/opengl/*.c \
./src/render/opengles2/*.c \
./src/render/software/*.c \
./src/sensor/*.c \
./src/sensor/dummy/*.c \
./src/stdlib/*.c \
./src/thread/*.c \
./src/thread/amigaos4/*.c \
./src/thread/generic/SDL_syscond.c \
./src/thread/generic/SDL_sysrwlock.c \
./src/thread/generic/SDL_systls.c \
./src/time/SDL_time.c \
./src/time/unix/SDL_systime.c \
./src/timer/*.c \
./src/timer/amigaos4/*.c \
./src/video/*.c \
./src/video/dummy/*.c \
./src/video/amigaos4/*.c \
./src/video/yuv2rgb/*.c \
TESTLIB_SOURCES =./src/test/*.c
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
TESTLIB_OBJECTS = $(shell echo $(TESTLIB_SOURCES) | sed -e 's,\.c,\.o,g')
VERSION_OBJECT = src/main/amigaos4/SDL_os4version.o
PREFS_OBJECT = amiga-extra/prefs.o
ALL_OBJECTS = $(OBJECTS) $(TESTLIB_OBJECTS) $(VERSION_OBJECT) $(PREFS_OBJECT)
DEPS = $(ALL_OBJECTS:.o=.d)
LOCALE_DESCRIPTOR = amiga-extra/sdl3.cd
LOCALE_TEMPLATE = amiga-extra/sdl3.ct
LOCALE_GENERATED = amiga-extra/locale_generated.h
all: info $(TARGET_STATIC) $(TARGET_SHARED) $(TESTLIB_STATIC) $(PREFS_PROGRAM)
@echo All done
info:
@echo Compiler flags: $(CFLAGS)
debug: CFLAGS += -DDEBUG
debug: all
locale: $(LOCALE_TEMPLATE) $(LOCALE_GENERATED)
$(TESTLIB_STATIC): $(TESTLIB_OBJECTS)
@echo Creating $@
@$(AR) crv $@ $^
@$(RANLIB) $@
$(TARGET_STATIC): $(OBJECTS)
@echo Creating $@
@$(AR) crv $@ $^
@$(RANLIB) $@
$(TARGET_SHARED): $(OBJECTS) $(VERSION_OBJECT)
@echo Linking $@
@$(CC) -mcrt=$(CRT) -shared -Wl,-soname,$(TARGET_SHARED) -o $(TARGET_SHARED) $(OBJECTS) $(VERSION_OBJECT)
$(PREFS_PROGRAM): $(PREFS_OBJECT)
$(CC) -o $@ $^
$(PREFS_OBJECT): amiga-extra/prefs.c $(LOCALE_GENERATED)
$(LOCALE_GENERATED): $(LOCALE_DESCRIPTOR)
$(CATCOMP) $(LOCALE_DESCRIPTOR) CFILE $@
$(LOCALE_TEMPLATE): $(LOCALE_DESCRIPTOR)
$(CATCOMP) $< CTFILE $(LOCALE_TEMPLATE)
clean:
@echo Cleaning
@rm -f $(TARGET_STATIC) $(TARGET_SHARED) $(TESTLIB_STATIC) $(ALL_OBJECTS) $(PREFS_PROGRAM) $(DEPS)
install:
mkdir -p $(INSTALL_PATH)/SDK/local/$(CRT)/lib
mkdir -p $(INSTALL_PATH)/SDK/local/$(CRT)/include/SDL3
cp -f $(TARGET_STATIC) $(INSTALL_PATH)/SDK/local/$(CRT)/lib
cp -f $(TARGET_SHARED) $(INSTALL_PATH)/SDK/local/$(CRT)/lib
cp -f $(TESTLIB_STATIC) $(INSTALL_PATH)/SDK/local/$(CRT)/lib
cp -f include/SDL3/*.h $(INSTALL_PATH)/SDK/local/$(CRT)/include/SDL3/
cp -f $(PREFS_PROGRAM) /SYS/Prefs/
%.o : %.c
@echo Compiling $<
@$(CC) -o $@ -c $< $(CFLAGS)
%.d : %.c
@echo Making dependencies for $<
@$(CC) -MM -MP -MT $(@:.d=.o) -o $@ $< $(CFLAGS)
# Load .d files
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
endif