summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 41323c3..7b8e235 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.POSIX:
CC = gcc
-CFLAGS = -std=c11 -Wall -Wno-unused-function --pedantic-errors -O3 `sdl2-config --cflags`
+CFLAGS = -std=c11 -Wall -Wno-unused-function --pedantic-errors -O3 `sdl2-config --cflags` -I./lib/
LDLIBS = `sdl2-config --libs`
AR = ar
ARFLAGS = rcs
@@ -11,14 +11,17 @@ all: libhitomezashi.a hitomezashi_cli
libhitomezashi.a: hitomezashi.o
$(AR) $(ARFLAGS) libhitomezashi.a hitomezashi.o
-hitomezashi.o: hitomezashi.c hitomezashi.h
+hitomezashi.o: lib/hitomezashi.c lib/hitomezashi.h
+ $(CC) -c $(CFLAGS) lib/hitomezashi.c
hitomezashi_cli: hitomezashi_cli.o libhitomezashi.a
+ $(CC) $(LDFLAGS) $(LDLIBS) -o hitomezashi_cli hitomezashi_cli.o libhitomezashi.a
-hitomezashi_cli.o: hitomezashi_cli.c hitomezashi_cli.h
+hitomezashi_cli.o: cli/hitomezashi_cli.c cli/hitomezashi_cli.h
+ $(CC) -c $(CFLAGS) -o hitomezashi_cli.o cli/hitomezashi_cli.c
format-code:
- clang-format -i --verbose *.c *.h
+ clang-format -i --verbose **/*.c **/*.h
clean:
rm -f *.a *.o hitomezashi_cli