-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (47 loc) · 1.53 KB
/
Makefile
File metadata and controls
61 lines (47 loc) · 1.53 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
CC=gcc
CFLAGS := -std=gnu23 -g -Wall -Werror -O2 $(shell pkg-config gtk4 vte-2.91-gtk4 libbsd-overlay libconfig --cflags)
LDFLAGS := $(shell pkg-config gtk4 vte-2.91-gtk4 libbsd-overlay libconfig --libs)
UNAME_S := $(shell uname -s)
# CFLAGS += -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
ifeq (${UNAME_S},Darwin)
CFLAGS += -mmacosx-version-min=13.0
EXTRA = zterm.app
else ifeq (${UNAME_S},Linux)
LDFLAGS += -lm
endif
BEAR := $(shell which bear)
ifeq (${BEAR},bear not found)
BEAR :=
else ifeq (${BEAR},)
BEAR :=
else
BEAR += --append --
endif
FILES = zterm.o menus.o prefs.o config.o
all: update_cflags zterm ${EXTRA}
debug : CFLAGS += -DDEBUG
debug : all
zterm: $(FILES)
$(BEAR) $(CC) -o $@ $^ $(LDFLAGS)
$(FILES): %.o: %.c .cflags
$(BEAR) $(CC) -c $(CFLAGS) -o $@ $<
tags: *.c
ctags *.c
Linux_terminal.icns: Linux_terminal.svg
./icon_gen Linux_terminal.svg
zterm.app: zterm Info.plist PkgInfo Linux_terminal.svg Makefile Linux_terminal.icns
rm -rf zterm.app
mkdir -p zterm.app/Contents/MacOS
mkdir -p zterm.app/Contents/Resources
cp Info.plist zterm.app/Contents/
cp PkgInfo zterm.app/Contents/
cp zterm zterm.app/Contents/MacOS/
cp Linux_terminal.icns zterm.app/Contents/Resources/
clean:
rm -rf *.o zterm zterm.app .cflags .syntastic_c_config compile_flags.txt compile_flags.json compile_commands.json tags
.PHONY: update_cflags compile_flags.txt
update_cflags: compile_flags.txt
@bash ./maybe_update .cflags "$(CFLAGS)"
compile_flags.txt:
@bash ./maybe_update $@ "$$(echo "${CFLAGS}" | sed 's/ /\n/g')"
# vim: set ts=8 sw=8: