-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
36 lines (27 loc) · 857 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
sources = $(wildcard sdk/*/*.cpp)
targets = $(sources:%.cpp=%)
sdk = build/udt4/src
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
LIBUDT = libudt.dylib
OS = OSX
else
LIBUDT = libudt.so
OS = Linux
endif
LDFLAGS = -L$(sdk) -ludt -lstdc++ -lpthread -lm
CCFLAGS = -Wall -D$(OS) -I$(sdk) -finline-functions -O3
all: $(targets)
$(targets): %: %.cpp build/udt4/src/$(LIBUDT)
gcc $< -o $@ $(LDFLAGS) $(CCFLAGS)
build/udt4/src/$(LIBUDT): build/udt4/Makefile
make -e os=$(OS) -C build/udt4
build/udt4/Makefile: build/udt.sdk.4.10.tar.gz
tar -C build -zxf $<
touch $@
build/udt.sdk.4.10.tar.gz:
@mkdir -p build
curl -Ls http://downloads.sourceforge.net/project/udt/udt/4.10/udt.sdk.4.10.tar.gz > [email protected]
[ "$$(cat [email protected] | $$(which md5sum || which md5) | cut -f1 -d' ')" = "6bb2d8454d67c920eb446fddb7d030c4" ] && mv [email protected] $@
clean:
rm -rf build