-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (52 loc) · 1.54 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
55
56
57
58
59
NAME := floodit
TARGET := $(NAME)
TARGETDIST := $(NAME).opk
DISTFILES := $(TARGET) ClearSans-Medium.ttf LICENCE.md README.md resources
OBJS := *.c
OPTS := -Wall -Wextra -Wmissing-declarations \
-Wcast-qual -Wconversion -Wsign-conversion \
-Wdisabled-optimization \
-Werror -Wfloat-equal -Wformat=2 \
-Wformat-nonliteral -Wformat-security \
-Wformat-y2k \
-Wimport -Winit-self -Winline \
-Winvalid-pch \
-Wlong-long \
-Wmissing-field-initializers -Wmissing-format-attribute \
-Wmissing-noreturn \
-Wpacked -Wpointer-arith \
-Wredundant-decls \
-Wshadow -Wstack-protector \
-Wstrict-aliasing=2 -Wswitch-default \
-Wswitch-enum \
-Wunreachable-code -Wunused \
-Wunused-parameter \
-Wvariadic-macros \
-Wwrite-strings
ifdef DEBUG
OPTS += -ggdb
else
OPTS += -O2
endif
LIB := -lSDL2 -lSDL2_ttf -lSDL2_net -lSDL2_image
CC := $(CROSS_COMPILE)gcc
STRIP := $(CROSS_COMPILE)strip
SDL2CONF = $(shell which sdl2-config)
CFLAGS += $(shell $(SDL2CONF) --cflags)
LDFLAGS += $(shell $(SDL2CONF) --libs)
$(TARGET): $(OBJS)
$(CC) $(OPTS) $(CFLAGS) $^ -o $(NAME) $(LIB)
ifndef DEBUG
$(STRIP) $(NAME)
endif
gcw: $(OBJS)
$(CC) $(OPTS) $(CFLAGS) -DGCW $^ -o $(NAME) $(LIB)
ifndef DEBUG
$(STRIP) $(NAME)
endif
opk:
cp -r $(DISTFILES) dist/
mksquashfs dist $(TARGETDIST) -all-root -noappend -no-exports -no-xattrs
clean:
rm -f $(TARGET) $(TARGETDIST)
rm -rf dist/$(TARGET) dist/ClearSans-Medium.ttf dist/resources