-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 853 Bytes
/
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
# C-compiler
CC=gcc
CFLAGS=-c -Wall
# Search for .c files in "src" directory; .h files in "include" directory
# The pattern matching character '%' matches filename without the extension
vpath %.c src helpers
vpath %.h include
all: proxy.out showip.out tcpclient.out
install: proxy.out showip.out tcpclient.out
chmod +x proxy.out
chmod +x showip.out
chmod +x tcpclient.out
mv proxy.out /usr/local/bin/proxy
mv showip.out /usr/local/bin/showip
mv tcpclient.out /usr/local/bin/tcpclient
proxy.out: proxy_parse.o proxy.o
$(CC) -o $@ proxy_parse.o proxy.o
proxy_parse.o: proxy_parse.c
$(CC) $(CFLAGS) $<
proxy.o: proxy.c
$(CC) $(CFLAGS) $<
showip.out: showip.o
$(CC) -o $@ $<
showip.o: showip.c
$(CC) $(CFLAGS) $<
tcpclient.out: tcpclient.o
$(CC) -o $@ $<
tcpclient.o: tcpclient.c
$(CC) $(CFLAGS) $<
clean:
rm *.o *.out 2>/dev/null