forked from chxry/cphosphor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
34 lines (25 loc) · 1.13 KB
/
Copy pathmakefile
File metadata and controls
34 lines (25 loc) · 1.13 KB
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
26
27
28
29
30
31
32
33
34
SRC = $(shell find src/ lib/cglm/src/ -type f -name '*.c') lib/glad/build/src/gl.c lib/vec/src/vec.c lib/microtar/src/microtar.c lib/map/src/map.c lib/cmixer/src/cmixer.c lib/parson/parson.c
OBJS = $(SRC:.c=.o)
TARGET = out
RES = res.tar
CFLAGS = -Wall -O2 -DIMGUI_IMPL_API="extern \"C\"" -c
CFLAGS += -Isrc -Ilib -Ilib/glad/build/include -Ilib/vec/src -Ilib/microtar/src -Ilib/map/src -Ilib/cmixer/src -Ilib/cimgui -Ilib/cimgui/imgui -Ilib/cglm/include -I/usr/include/SDL2
LDFLAGS = -ldl -lSDL2 -lm -llua
$(TARGET): $(OBJS) $(RES)
clang++ $(LDFLAGS) $(OBJS) lib/cimgui/libcimgui.a imgui_sdl.o imgui_opengl3.o -o $(TARGET)
cimgui:
make -C lib/cimgui static
clang++ $(CFLAGS) lib/cimgui/imgui/backends/imgui_impl_sdl.cpp -o imgui_sdl.o
clang++ $(CFLAGS) lib/cimgui/imgui/backends/imgui_impl_opengl3.cpp -o imgui_opengl3.o
glad:
cd lib/glad && python -m glad --extensions='' --api="gl:core" --out-path=build --reproducible c
$(RES): res
tar -cf $(RES) res
%.o: %.c
clang $(CFLAGS) $< -o $@
run: $(TARGET)
./out
format:
clang-format -i $(shell find src/ -type f -name '*.[ch]')
clean:
rm -rf $(OBJS) $(TARGET) $(RES) imgui_sdl.o imgui_opengl3.o