Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 37 lines (27 sloc) 0.857 kb
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 > $@.tmp
[ "$$(cat $@.tmp | $$(which md5sum || which md5) | cut -f1 -d' ')" = "6bb2d8454d67c920eb446fddb7d030c4" ] && mv $@.tmp $@

clean:
rm -rf build
Something went wrong with that request. Please try again.