-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 801 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (23 loc) · 801 Bytes
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
# srcterm — Source Engine developer-console terminal (C++ / Xlib / Xft / libvterm)
CXX ?= g++
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra
PKGS = x11 xft fontconfig vterm
CXXFLAGS += $(shell pkg-config --cflags $(PKGS))
LIBS = $(shell pkg-config --libs $(PKGS)) -lutil
PREFIX ?= $(HOME)/.local
SRC = $(wildcard src/*.cpp)
OBJ = $(SRC:.cpp=.o)
DEP = $(wildcard src/*.h)
srcterm: $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $(OBJ) $(LIBS)
# Every object depends on every header — the modules are small and tightly
# coupled through app.h, so a blanket dependency keeps rebuilds correct.
src/%.o: src/%.cpp $(DEP)
$(CXX) $(CXXFLAGS) -c -o $@ $<
run: srcterm
./srcterm
install: srcterm
ln -sf $(CURDIR)/srcterm $(PREFIX)/bin/srcterm
clean:
rm -f srcterm src/*.o
.PHONY: run install clean