This repository has been archived by the owner on Jan 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
54 lines (39 loc) · 1.47 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
48
49
50
51
52
53
54
TARGET ?= ativayeban
ifeq ($(TARGET), ativayeban-od)
CC := mipsel-linux-gcc
STRIP := mipsel-linux-strip
OBJS = platform/opendingux.o
else
CC := gcc
STRIP := strip
OBJS = platform/general.o
endif
SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
OBJS += main.o init.o player.o title.o game.o score.o bg.o draw.o text.o unifont.o
HEADERS += main.h init.h platform.h player.h title.h game.h score.h bg.h draw.h text.h unifont.h
INCLUDE := -I.
DEFS :=
CFLAGS = $(SDL_CFLAGS) -Wall -Wno-unused-variable \
-O2 -fomit-frame-pointer $(DEFS) $(INCLUDE)
LDFLAGS := $(SDL_LIBS) -lm -lSDL_image
include Makefile.rules
.PHONY: all opk
all: $(TARGET)
$(TARGET): $(OBJS)
opk: $(TARGET).opk
$(TARGET).opk: $(TARGET)
$(SUM) " OPK $@"
$(CMD)rm -rf .opk_data
$(CMD)cp -r data .opk_data
$(CMD)cp $< .opk_data/$(TARGET)
$(CMD)$(STRIP) .opk_data/$(TARGET)
$(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)