-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefileX86
54 lines (38 loc) · 1.49 KB
/
MakefileX86
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
CC := gcc
STRIP := strip
SYSROOT := $(shell $(CC) --print-sysroot)
SDL1_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags) -DSDL_1
SDL1_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs) -lSDL_image -lSDL_mixer
SDL2_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl2-config --cflags) -DSDL_2
SDL2_LIBS := $(shell $(SYSROOT)/usr/bin/sdl2-config --libs) -lSDL2_image -lSDL2_mixer
OBJS := sdl-1.2.o sdl-2.o
HEADERS :=
INCLUDE := -I.
DEFS +=
CFLAGS = -Wall -Wno-unused-variable -g -fomit-frame-pointer $(DEFS) $(INCLUDE)
LDFLAGS :=
.PHONY: all opk
all: AF-84-sdl-1.2 AF-84-sdl-2
include Makefile.rules
AF-84-sdl-1.2: sdl-1.2.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(SDL1_CFLAGS) $(SDL1_LIBS)
AF-84-sdl-2: sdl-2.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(SDL2_CFLAGS) $(SDL2_LIBS)
sdl-1.2.o: sdl.c
$(CC) $(CFLAGS) $(SDL1_CFLAGS) -o $@ -c $<
sdl-2.o: sdl.c
$(CC) $(CFLAGS) $(SDL2_CFLAGS) -o $@ -c $<
opk: AF-84.opk
AF-84.opk: AF-84-sdl-1.2 AF-84-sdl-2
$(SUM) " OPK $@"
$(CMD)rm -rf .opk_data
$(CMD)cp -r data .opk_data
$(CMD)cp $^ .opk_data
$(CMD)mksquashfs .opk_data $@ -all-root -noappend -no-exports -no-xattrs -no-progress >/dev/null
# The two below declarations ensure that editing a .c file recompiles only that
# file, but editing a .h file recompiles everything.
# Courtesy of Maarten ter Huurne.
# Each object file depends on its corresponding source file.
$(C_OBJS): %.o: %.c
# Object files all depend on all the headers.
$(OBJS): $(HEADERS)