diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile b/Makefile index 4face93..e44f590 100644 --- a/Makefile +++ b/Makefile | |||
@@ -1,14 +1,15 @@ | |||
1 | PROJECT = mazeoflife | 1 | PROJECT = mazeoflife |
2 | LTARGET = build/$(PROJECT) | 2 | LTARGET = build/$(PROJECT) |
3 | WTARGET = build/$(PROJECT).exe | 3 | WTARGET = build/$(PROJECT).exe |
4 | CC = g++ | 4 | CC = g++ |
5 | WINCC = i586-mingw32msvc-g++ | 5 | WINCC = i586-mingw32msvc-g++ |
6 | WINDRES = i586-mingw32msvc-windres | 6 | WINDRES = i586-mingw32msvc-windres |
7 | FILES = $(addprefix build/,$(wildcard *.cpp)) | 7 | FILES = $(addprefix build/,$(wildcard *.cpp)) |
8 | HEADERS = $(wildcard *.h) | ||
8 | MODULES = $(patsubst %.cpp,%,$(FILES)) | 9 | MODULES = $(patsubst %.cpp,%,$(FILES)) |
9 | SOURCES = $(addsuffix .o,$(MODULES)) | 10 | SOURCES = $(addsuffix .o,$(MODULES)) |
10 | WINSRC = $(addsuffix win,$(SOURCES)) | 11 | WINSRC = $(addsuffix win,$(SOURCES)) |
11 | IMAGES = $(wildcard *.bmp) | 12 | IMAGES = $(wildcard *.bmp) |
12 | CIMAGES = $(addprefix build/,$(IMAGES:.bmp=.bmp.o)) | 13 | CIMAGES = $(addprefix build/,$(IMAGES:.bmp=.bmp.o)) |
13 | LINCCFL = `sdl-config --cflags` | 14 | LINCCFL = `sdl-config --cflags` |
14 | LINLDFL = `sdl-config --libs` | 15 | LINLDFL = `sdl-config --libs` |
@@ -28,14 +29,14 @@ clean: | |||
28 | $(LTARGET): $(SOURCES) $(CIMAGES) | 29 | $(LTARGET): $(SOURCES) $(CIMAGES) |
29 | $(CC) $(SOURCES) $(CIMAGES) -o $(LTARGET) $(LINLDFL) | 30 | $(CC) $(SOURCES) $(CIMAGES) -o $(LTARGET) $(LINLDFL) |
30 | 31 | ||
31 | $(SOURCES): build/%.o: %.cpp | 32 | $(SOURCES): build/%.o: %.cpp $(HEADERS) |
32 | $(CC) -c $? -o $@ $(LINCCFL) | 33 | $(CC) -c $< -o $@ $(LINCCFL) |
33 | 34 | ||
34 | $(WTARGET): $(WINSRC) $(CIMAGES) build/winres.o | 35 | $(WTARGET): $(WINSRC) $(CIMAGES) build/winres.o |
35 | $(WINCC) $(WINSRC) $(CIMAGES) build/winres.o -o $(WTARGET) $(WINLDFL) | 36 | $(WINCC) $(WINSRC) $(CIMAGES) build/winres.o -o $(WTARGET) $(WINLDFL) |
36 | 37 | ||
37 | $(WINSRC): build/%.owin: %.cpp | 38 | $(WINSRC): build/%.owin: %.cpp $(HEADERS) |
38 | $(WINCC) -c $? -o $@ $(WINCCFL) | 39 | $(WINCC) -c $< -o $@ $(WINCCFL) |
39 | 40 | ||
40 | build/winres.o: winres.rc | 41 | build/winres.o: winres.rc |
41 | $(WINDRES) $? $@ | 42 | $(WINDRES) $? $@ |