-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
146 lines (104 loc) · 3.06 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/make -f
include dist/shared.mk
override CFLAGS += -I./misc
# misc targets
ifdef obj
default: $(addprefix $(OBJ)/,$(subst $(comma),$(space),$(obj)))
else
CURRENT_BINS := $(wildcard $(OBJ)/*)
ifneq ($(CURRENT_BINS),)
default: $(CURRENT_BINS)
else
default: basic
endif
endif
$(dummy): $(OBJ)/config.h
$(dummy): $(OBJ)/config-krb5.h
$(verbose_hide) touch $@
# compile targets
.PHONY: basic
basic: $(OBJ)/args
basic: $(OBJ)/gettime
basic: $(OBJ)/mkpasswd
basic: $(OBJ)/natsort
basic: $(OBJ)/pause
basic: $(OBJ)/spawn
basic: $(OBJ)/unescape
basic: $(OBJ)/urlencode
basic: $(OBJ)/hex
basic: $(OBJ)/unhex
basic: $(OBJ)/proctool
basic: $(OBJ)/strtool
basic: $(OBJ)/zlib
.PHONY: linux
linux: $(OBJ)/ac-wait
linux: $(OBJ)/libfunsync.so
linux: $(OBJ)/libwcwidth.so
linux: $(OBJ)/ssh_force_lp.so
linux: $(OBJ)/unsymlink.so
linux: $(OBJ)/peekvc
linux: $(OBJ)/showsigmask
linux: $(OBJ)/statx
linux: $(OBJ)/tapchown
linux: $(OBJ)/writevt
.PHONY: krb
krb: $(OBJ)/k5userok
krb: $(OBJ)/pklist
.PHONY: all
all: basic krb
ifeq ($(UNAME),Linux)
all: linux
endif
.PHONY: pklist
pklist: $(OBJ)/pklist
emergency-su: $(OBJ)/emergency-su
sudo install -o 'root' -g 'wheel' -m 'u=rxs,g=rx,o=' $< /usr/bin/$@
$(OBJ)/libfunsync.so: CFLAGS += -shared
$(OBJ)/libfunsync.so: misc/libfunsync.c
$(OBJ)/ssh_force_lp.so: CFLAGS += -shared
$(OBJ)/ssh_force_lp.so: misc/ssh_force_lp.c
$(OBJ)/unsymlink.so: CFLAGS += -shared
$(OBJ)/unsymlink.so: LDLIBS += $(DL_LDLIBS)
$(OBJ)/unsymlink.so: misc/unsymlink.c
$(OBJ)/libwcwidth.so: CFLAGS += -shared -fPIC \
-Dmk_wcwidth=wcwidth -Dmk_wcswidth=wcswidth
$(OBJ)/libwcwidth.so: thirdparty/wcwidth.c
$(OBJ)/misc_util.o: misc/util.c misc/util.h
$(OBJ)/strnatcmp.o: thirdparty/strnatcmp.c
$(OBJ)/ac-wait: LDLIBS += -ludev
$(OBJ)/ac-wait: misc/ac-wait.c
$(OBJ)/args: misc/args.c
$(OBJ)/gettime: LDLIBS += -lrt
$(OBJ)/gettime: misc/gettime.c
$(OBJ)/hex: misc/hex.c
$(OBJ)/k5userok: CFLAGS += $(KRB_CFLAGS)
$(OBJ)/k5userok: LDLIBS += $(KRB_LDLIBS)
$(OBJ)/k5userok: kerberos/k5userok.c
$(OBJ)/mkpasswd: LDLIBS += $(CRYPT_LDLIBS)
$(OBJ)/mkpasswd: misc/mkpasswd.c
$(OBJ)/natsort: thirdparty/natsort.c $(OBJ)/strnatcmp.o
$(OBJ)/peekvc: thirdparty/peekvc.c
$(OBJ)/pklist: CFLAGS += $(KRB_CFLAGS)
$(OBJ)/pklist: LDLIBS += $(KRB_LDLIBS)
$(OBJ)/pklist: kerberos/pklist.c
$(OBJ)/pause: misc/pause.c
$(OBJ)/proctool: misc/proctool.c $(OBJ)/misc_util.o
$(OBJ)/showsigmask: CFLAGS += -I$(OBJ)
$(OBJ)/showsigmask: misc/showsigmask.c
$(OBJ)/spawn: misc/spawn.c $(OBJ)/misc_util.o
$(OBJ)/statx: misc/statx.c
$(OBJ)/strtool: misc/strtool.c
$(OBJ)/tapchown: misc/tapchown.c
$(OBJ)/unescape: misc/unescape.c
$(OBJ)/unhex: misc/unhex.c
$(OBJ)/urlencode: misc/urlencode.c
$(OBJ)/writevt: thirdparty/writevt.c
$(OBJ)/zlib: LDLIBS += -lz
$(OBJ)/zlib: thirdparty/zpipe.c
$(OBJ)/newrdt: LDLIBS += -lresolv
$(OBJ)/newrdt: misc/rdt.c
$(OBJ)/gl-mem: CFLAGS += $(shell pkg-config --cflags x11 epoxy)
$(OBJ)/gl-mem: LDLIBS += $(shell pkg-config --libs x11 epoxy)
$(OBJ)/gl-mem: misc/gl-mem.c
$(OBJ)/emergency-su: LDLIBS += $(CRYPT_LDLIBS)
$(OBJ)/emergency-su: misc/emergency-su.c