forked from vygr/ChrysaLisp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 885 Bytes
/
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
OS := $(shell uname)
CPU := $(shell uname -m)
all: obj/$(OS)/$(CPU)/main
undo: clean
unzip -oq snapshot_old.zip
backup:
cp -f snapshot.zip snapshot_old.zip
snapshot:
rm -f snapshot.zip
zip -r9ovq -x*.d -x*.o snapshot.zip obj/*
obj/$(OS)/$(CPU)/main: obj/$(OS)/$(CPU)/main.o
ifeq ($(OS),Darwin)
cc -o $@ [email protected] -Wl,-framework,SDL2 -Wl,-framework,SDL2_ttf
endif
ifeq ($(OS),Linux)
cc -o $@ [email protected] $(shell sdl2-config --libs) -lSDL2_ttf
endif
obj/$(OS)/$(CPU)/main.o: main.c Makefile
echo $(CPU) > arch
echo $(OS) > platform
unzip -nq snapshot.zip
ifeq ($(OS),Darwin)
cc -c -nostdlib -fno-exceptions \
-I/Library/Frameworks/SDL2.framework/Headers/ \
-I/Library/Frameworks/SDL2_ttf.framework/Headers/ \
-o $@ $<
endif
ifeq ($(OS),Linux)
cc -c -nostdlib -fno-exceptions \
-I/usr/include/SDL2/ \
-o $@ $<
endif
clean:
rm -rf obj/