-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.osx
36 lines (25 loc) · 846 Bytes
/
Makefile.osx
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
CC=gcc
SDLCONFIG=sdl-config
ifndef datadir
datadir=.
endif
ifndef highscoredir
highscoredir=.
endif
CFLAGS=-Wall $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\"$(datadir)\" -DHISCOREPREFIX=\"$(highscoredir)\"
SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
menu.c options.c fullscreen.c themes.c event.c titlebar.c benchmark.c \
misc.c lock.c delay.c
SDL_MIXER=-lSDL_mixer
SDL_LIB=$(SDL_MIXER) $(SDL_LDFLAGS)
SDL_CFLAGS := $(shell $(SDLCONFIG) --cflags)
SDL_LDFLAGS := $(shell $(SDLCONFIG) --libs)
all: icebreaker
icebreaker: $(SRC:.c=.o)
$(CC) $(CFLAGS) $^ -o icebreaker $(SDL_LIB)
%.d: %.c
set -e; $(CC) -M $(CFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
[ -s $@ ] || rm -f $@
include $(SRC:.c=.d)