summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoruntir_l <87096069+untir-l@users.noreply.github.com>2022-02-18 14:05:08 +0000
committeruntir-l <87096069+untir-l@users.noreply.github.com>2022-02-25 09:56:49 +0000
commit581bc2dd768ca0af390b9abb41a5c89f1bca19e3 (patch)
tree2b8ef613b6448099852c9bf3487915c13d3ceea7 /Makefile
parent1bc2a436583b0e898decf13e695a1908a894a38c (diff)
downloadhitomezashi-581bc2dd768ca0af390b9abb41a5c89f1bca19e3.tar
hitomezashi-581bc2dd768ca0af390b9abb41a5c89f1bca19e3.tar.gz
hitomezashi-581bc2dd768ca0af390b9abb41a5c89f1bca19e3.zip
Reorganise CLI and lib into separate dirs, add doc comments for Doxygen
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