CXX = g++

CCFLAGS = -Wall -I../src -finline-functions -O3
LDFLAGS = -L../src -ludt -lstdc++ -pthread -lm

DIR = $(shell pwd)

APP = appserver appclient sendfile recvfile test

all: $(APP)

%.o: %.cpp
	$(CXX) $(CCFLAGS) $< -c

appserver: appserver.o
	$(CXX) $^ -o $@ $(LDFLAGS)
appclient: appclient.o
	$(CXX) $^ -o $@ $(LDFLAGS)
sendfile: sendfile.o
	$(CXX) $^ -o $@ $(LDFLAGS)
recvfile: recvfile.o
	$(CXX) $^ -o $@ $(LDFLAGS)
test: test.o
	$(CXX) $^ -o $@ $(LDFLAGS)

clean:
	rm -f *.o $(APP)

install:
	export PATH=$(DIR):$$PATH
