-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
88 lines (61 loc) · 2.12 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# output executable
output = 12term
all: $(output) terminfo
# all the .c files
srcdir = src
srcs = x tty debug buffer ctlseqs keymap csi draw event settings icon clipboard #lua
srcs += xft/freetype xft/glyphs xft/render xft/cache xft/bitmap
srcs := $(srcs:=.c) #append .c to names
#lua_version = 5.2
# libs to include with -l<name>
libs = util
# rt: realtime extensions
# util: pty stuff
# arguments for pkg-config
pkgs = x11 xrender freetype2 fontconfig xcursor #lua$(lua_version) #//harfbuzz
# fontconfig: (loading fonts)
# freetype2: (font rendering)
# X11: X window system (graphics, input, etc.)
CFLAGS+= -g # include debug symbols
CFLAGS+= -O2
#CFLAGS+= -s -Os
CFLAGS+= -Wall -Wextra -pedantic -std=c11 # turn on a bunch of warnings
CFLAGS+= -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-parentheses -Wno-char-subscripts # disable these warnings
CFLAGS+= -Werror=implicit-function-declaration -Werror=incompatible-pointer-types # make these warnings into errors
# Install the terminfo file
# call `tic -D` to figure out the location of terminfo files
# todo: check if this fails?
terminfo != tic -D 2>/dev/null | head -n1
terminfo:= $(terminfo)/x/xterm-12term
# create a rule with a consistent name so you can type `make terminfo` instead of `make ~/.terminfo/x/xterm-12term` or whatever
.PHONY: terminfo
terminfo: $(terminfo)
# actual terminfo rule
$(terminfo): terminfo.src
@$(call print,$@,,$^,)
@tic -x $<
clean_extra+= $(terminfo)
install ?= /usr/local
# install desktop and icon files
icon = $(install)/share/icons/hicolor/48x48/apps/12term.png
$(icon): 48x48.png
@$(call print,$@,,$^,)
@cp $< $@
desktop = $(install)/share/applications/12term.desktop
$(desktop): 12term.desktop
@$(call print,$@,,$^,)
@cp $< $@
bin = $(install)/bin/12term
$(bin): 12term
@$(call print,$@,,$^,)
@cp $< $@
.PHONY: install uninstall
install: $(bin) $(terminfo) $(icon) $(desktop)
uninstall:
$(RM) $(terminfo)
$(RM) $(bin)
$(RM) $(icon)
$(RM) $(desktop)
include .Nice.mk
# the compiler's dependency checker can't see assembly .incbin directives, so I have to add this manually.
$(junkdir)/icon.c.o: icon.bin