aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 8f0bbe118c598c5776838651b4d8231a5d13326f (plain) (blame)
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
CFLAGS = -std=c99 -Wall -Wextra -pedantic -Wno-deprecated-declarations -D_XOPEN_SOURCE=700L
LDFLAGS = -lSDL2 -lSDL2_ttf

SRC = main.c microui.c renderer.c widget.c ui.c unit.c engine.c
OBJ = ${SRC:.c=.o}
HDR = microui.h renderer.h widget.h ui.h unit.h engine.h

TEST_SRC = test.c test_angular_speed.c test_pressure.c test_volume.c test_volume_flow_rate.c unit.c
TEST_OBJ = ${TEST_SRC:.c=.o}

volute: ${OBJ}
	${CC} -o $@ $^ ${LDFLAGS}

test: ${TEST_OBJ}
	${CC} -o $@ $^ ${LDFLAGS}
	./$@

clean:
	rm -f volute test *.o

%.o: %.c
	${CC} -c ${CFLAGS} $<

${OBJ}: ${HDR}
${TEST_OBJ}: ${HDR} test.h