-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
32 lines (25 loc) · 850 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
objlist := puzzle utility playfield draw frenzy frenzyct avalanche reversiball pillars menu config random
program_title = puzzle
CC := gcc
LD := gcc
objdir := obj
srcdir := src
objlisto := $(foreach o,$(objlist),$(objdir)/$(o).o)
# FL4SHK updated this makefile to work on Linux. Date of update: Jun 1, 2016
ifeq ($(OS),Windows_NT)
CFLAGS := -Wall -O2 -std=gnu99 -ggdb
LDLIBS := -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer
LDFLAGS := -Wl,-subsystem,windows
else
CFLAGS := -Wall -O2 -std=gnu99 `sdl2-config --cflags` -ggdb
LDLIBS := `sdl2-config --libs` -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer
#LDFLAGS := -Wl
endif
puzzle: $(objlisto)
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(objdir)/%.o: $(srcdir)/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
-rm $(objdir)/*.o