-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakefile
95 lines (70 loc) · 2.38 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
# Time-stamp: <02/11/09 10:40:24 INGA>
# File: Makefile
COMPILE=g++
CC=gcc
LINK=g++
GIT=git
CARG=-c -O4 -Wall -DVERSION=\"$(GIT_VERSION)\"
DESTDIR=/
PREFIX=$(DESTDIR)/usr/local
DEPDIR=.deps
OBJECTa= udpclient.o rnd.o version.o
OBJECTb= udpserver.o sample.o version.o
OBJECTb1= udpecho.o
OBJECTc= tcpclient.o rnd.o
OBJECTd= tcpserver.o sample.o
OBJECTe= icmpclient.o rnd.o
OBJECT= server.o sample.o version.o
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
targeta=udpclient
targetb=udpserver
targetb1=udpecho
targetc=tcpclient
targetd=tcpserver
targete=icmpclient
target=server
all: $(OBJECTa) $(OBJECTb) $(OBJECTb1) $(OBJECTc) $(OBJECTd) $(OBJECTe) $(OBJECT)
$(COMPILE) -o $(targeta) $(OBJECTa)
$(COMPILE) -o $(targetb) $(OBJECTb)
$(CC) -o $(targetb1) $(OBJECTb1)
$(COMPILE) -o $(targetc) $(OBJECTc)
$(COMPILE) -o $(targetd) $(OBJECTd)
$(COMPILE) -o $(targete) $(OBJECTe)
$(COMPILE) -o $(target) $(OBJECT)
clean:
rm -f *.o *.exe
rm -r $(targeta) $(targetb) $(targetb1) $(targetc) $(targetd) $(targete) $(target)
install:
install -m 0755 udpclient $(PREFIX)/bin
install -m 0755 udpserver $(PREFIX)/bin
install -m 0755 udpecho $(PREFIX)/bin
install -m 0755 tcpclient $(PREFIX)/bin
install -m 0755 tcpserver $(PREFIX)/bin
install -m 0755 icmpclient $(PREFIX)/bin
install -m 0755 server $(PREFIX)/bin
server.o: server.cpp
$(COMPILE) $(CARG) server.cpp
udpserver.o: udpserver.cpp
$(COMPILE) $(CARG) udpserver.cpp
udpecho.o: udpecho.c
$(CC) $(CARG) udpecho.c
udpclient.o: udpclient.cpp
$(COMPILE) $(CARG) udpclient.cpp
sample.o: sample.cpp sample.h
$(COMPILE) $(CARG) sample.cpp
rnd.o: rnd.cpp rnd.h makefile
$(COMPILE) $(CARG) rnd.cpp
tcpserver.o: tcpserver.cpp
$(COMPILE) $(CARG) tcpserver.cpp
tcpclient.o: tcpclient.cpp
$(COMPILE) $(CARG) tcpclient.cpp
icmpclient.o: icmpclient.cpp
$(COMPILE) $(CARG) icmpclient.cpp
version.o: .FORCE
$(GIT) rev-parse HEAD | awk ' BEGIN {print "#include \"version.h\""} {print "const char * build_git_sha = \"" $$0"\";"} END {}' > version.c
date | awk 'BEGIN {} {print "const char * build_git_time = \""$$0"\";"} END {} ' >> version.c
$(COMPILE) $(CARG) version.c
version.c: .FORCE
$(GIT) rev-parse HEAD | awk ' BEGIN {print "#include \"version.h\""} {print "const char * build_git_sha = \"" $$0"\";"} END {}' > version.c
date | awk 'BEGIN {} {print "const char * build_git_time = \""$$0"\";"} END {} ' >> version.c
.FORCE: