-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (26 loc) · 901 Bytes
/
Makefile
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
35
36
CC = clang
CFLAGS = -gdwarf-4 -Wall -O0 $$(pkg-config --cflags freetype2) -fstack-usage
LFLAGS = -lglfw -lGL $$(pkg-config --libs freetype2) -lm
SRCDIR = src
RESDIR = res
LIBDIR = lib
BUILDDIR = build
HEADER_FILES = terminal.h commands.h colors.h keys.h glyph.h
HEADERS = $(patsubst %,$(SRCDIR)/%,$(HEADER_FILES))
OBJ_FILES = terminal.o commands.o glad.o glyph.o
OBJS = $(patsubst %,$(BUILDDIR)/%,$(OBJ_FILES))
all: build_dir copy_shaders copy_fonts terminal
terminal: $(OBJS)
$(CC) $^ -o $(BUILDDIR)/$@ $(LFLAGS)
$(BUILDDIR)/%.o: $(SRCDIR)/%.c $(HEADERS)
$(CC) -c $(CFLAGS) -o $@ $<
$(BUILDDIR)/%.o: $(LIBDIR)/glad/%.c
$(CC) -c $(CFLAGS) -o $@ $< -Ilib
build_dir:
mkdir -p build/shaders && mkdir -p build/fonts
copy_shaders: $(SRCDIR)/shaders/*.glsl
cp $(SRCDIR)/shaders/*.glsl $(BUILDDIR)/shaders
copy_fonts: $(RESDIR)/*.ttf
cp $(RESDIR)/*.ttf $(BUILDDIR)/fonts
clean:
rm -rf build