Mercurial > molko
annotate Makefile @ 19:bc1fdff76775
core: implement most useful events, closes #2445
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 08 Jan 2020 13:33:41 +0100 |
parents | fc71221b7bee |
children | 2fb93d57c098 |
rev | line source |
---|---|
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 # |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 # Makefile -- basic Makefile for Molko's Adventure |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 # |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 # Copyright (c) 2020 David Demelier <markand@malikania.fr> |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 # |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 # Permission to use, copy, modify, and/or distribute this software for any |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 # purpose with or without fee is hereby granted, provided that the above |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # copyright notice and this permission notice appear in all copies. |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 # |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 # |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 .POSIX: |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 CC= clang |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
22 CFLAGS= -MMD -O3 -DNDEBUG -D_XOPEN_SOURCE=700 -std=c99 -Wall -Wextra |
8 | 23 PROG= molko |
12
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
24 LIB= libmolko.a |
7
fbb7101b7bd8
core: implement animations, closes #2439
David Demelier <markand@malikania.fr>
parents:
6
diff
changeset
|
25 SRCS= src/animation.c \ |
fbb7101b7bd8
core: implement animations, closes #2439
David Demelier <markand@malikania.fr>
parents:
6
diff
changeset
|
26 src/clock.c \ |
19
bc1fdff76775
core: implement most useful events, closes #2445
David Demelier <markand@malikania.fr>
parents:
17
diff
changeset
|
27 src/event.c \ |
10
c91c3272101b
core: implement fonts, closes #2444
David Demelier <markand@malikania.fr>
parents:
8
diff
changeset
|
28 src/font.c \ |
6
3054723e53d7
core: implement clock, closes #2443
David Demelier <markand@malikania.fr>
parents:
5
diff
changeset
|
29 src/image.c \ |
5
b5c649b6367b
core: implement sprites, closes #2440
David Demelier <markand@malikania.fr>
parents:
4
diff
changeset
|
30 src/sprite.c \ |
4
cd58eabb7fb4
core: implement basic images, closes #2441
David Demelier <markand@malikania.fr>
parents:
0
diff
changeset
|
31 src/texture.c \ |
cd58eabb7fb4
core: implement basic images, closes #2441
David Demelier <markand@malikania.fr>
parents:
0
diff
changeset
|
32 src/window.c |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 OBJS= ${SRCS:.c=.o} |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 DEPS= ${SRCS:.c=.d} |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 |
10
c91c3272101b
core: implement fonts, closes #2444
David Demelier <markand@malikania.fr>
parents:
8
diff
changeset
|
36 SDL_CFLAGS= `pkg-config --cflags sdl2 SDL2_image SDL2_ttf` |
c91c3272101b
core: implement fonts, closes #2444
David Demelier <markand@malikania.fr>
parents:
8
diff
changeset
|
37 SDL_LDFLAGS= `pkg-config --libs sdl2 SDL2_image SDL2_ttf` |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
39 EXPAT_CFLAGS= `pkg-config --cflags expat` |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
40 EXPAT_LDFLAGS= `pkg-config --libs expat` |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
41 |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
42 TESTS= tests/test-color.c |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
43 TESTS_INCS= -I extern/libgreatest -I src ${SDL_CFLAGS} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
44 TESTS_LIBS= ${LIB} ${SDL_LDFLAGS} ${LDFLAGS} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
45 TESTS_OBJS= ${TESTS:.c=} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
46 TESTS_DEPS= ${TESTS:.c=.d} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
47 |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
48 TOOLS= tools/molko-map.c |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
49 TOOLS_OBJS= ${TOOLS:.c=} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
50 TOOLS_DEPS= ${TOOLS:.c=.d} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
51 |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
52 .SUFFIXES: |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 .SUFFIXES: .c .o |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 |
8 | 55 all: ${PROG} |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
56 |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
57 -include ${DEPS} ${TESTS_DEPS} ${TOOLS_DEPS} |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
58 |
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
59 .c.o: |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
60 ${CC} ${SDL_CFLAGS} ${CFLAGS} -c $< -o $@ |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
61 |
12
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
62 .c: |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
63 ${CC} ${TESTS_INCS} -o $@ ${CFLAGS} $< ${TESTS_LIBS} |
12
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
64 |
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
65 ${LIB}: ${OBJS} |
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
66 ${AR} -rcs $@ ${OBJS} |
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
67 |
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
68 ${PROG}: ${LIB} src/main.o |
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
69 ${CC} -o $@ src/main.o ${LIB} ${SDL_LDFLAGS} ${LDFLAGS} |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
70 |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
71 ${TESTS_OBJS}: ${LIB} |
0
efcc908bca21
core: implement basic windowing, closes #2437
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
72 |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
73 tests: ${TESTS_OBJS} |
12
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
74 for t in $?; do ./$$t; done |
29b479760c05
tests: implement basic tests, closes #2447
David Demelier <markand@malikania.fr>
parents:
10
diff
changeset
|
75 |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
76 tools: ${TOOLS_OBJS} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
77 |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
78 tools/molko-map: tools/molko-map.c |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
79 ${CC} -o $@ $< ${CFLAGS} ${EXPAT_CFLAGS} ${EXPAT_LDFLAGS} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
80 |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
81 clean: |
17
fc71221b7bee
core: minimal cleanups
David Demelier <markand@malikania.fr>
parents:
16
diff
changeset
|
82 rm -f ${PROG} src/main.o src/main.d |
fc71221b7bee
core: minimal cleanups
David Demelier <markand@malikania.fr>
parents:
16
diff
changeset
|
83 rm -f ${LIB} ${OBJS} ${DEPS} |
16
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
84 rm -f ${TESTS_OBJS} ${TESTS_DEPS} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
85 rm -f ${TOOLS_OBJS} ${TOOLS_DEPS} |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
86 |
621c815c9509
tools: implement basic molko-map stub, continue #2448
David Demelier <markand@malikania.fr>
parents:
12
diff
changeset
|
87 .PHONY: clean tests tools |