-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
53 lines (39 loc) · 1.34 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CC=gcc
CFLAGS := -g -Wall -Werror -O2 $(shell pkg-config gtk4 vte-2.91-gtk4 libbsd-overlay --cflags)
LDFLAGS := $(shell pkg-config gtk4 vte-2.91-gtk4 libbsd-overlay --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
FILES = zterm.o menus.o config.o
all: update_cflags tags zterm ${EXTRA}
debug : CFLAGS += -DDEBUG
debug : all
zterm: $(FILES)
$(CC) -o $@ $^ $(LDFLAGS)
$(FILES): %.o: %.c .cflags
$(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
.PHONY: update_cflags .syntastic_c_config compile_flags.txt
update_cflags: .syntastic_c_config compile_flags.txt
@bash ./maybe_update .cflags "$(CFLAGS)"
.syntastic_c_config compile_flags.txt:
@bash ./maybe_update $@ "$$(echo "${CFLAGS}" | sed 's/ /\n/g')"
# vim: set ts=8 sw=8: