Changed directory structure

This commit is contained in:
Friedrich Schöller 2013-05-02 00:57:51 +02:00
parent 34acb3f6d5
commit 455da8b0da
36 changed files with 48 additions and 37 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/hans
/build

View File

View File

@ -4,50 +4,59 @@ TUN_DEV_FILE = `sh osflags dev $(MODE)`
GCC = gcc
GPP = g++
.PHONY: directories
all: hans
hans: tun.o sha1.o main.o client.o server.o auth.o worker.o time.o tun_dev.o echo.o exception.o utility.o
$(GPP) -o hans tun.o sha1.o main.o client.o server.o auth.o worker.o time.o tun_dev.o echo.o exception.o utility.o $(LDFLAGS)
directories: build_dir
utility.o: utility.cpp utility.h
$(GPP) -c utility.cpp $(CFLAGS)
build_dir:
mkdir -p build
exception.o: exception.cpp exception.h
$(GPP) -c exception.cpp $(CFLAGS)
tunemu.o: directories build/tunemu.o
echo.o: echo.cpp echo.h exception.h
$(GPP) -c echo.cpp $(CFLAGS)
hans: directories build/tun.o build/sha1.o build/main.o build/client.o build/server.o build/auth.o build/worker.o build/time.o build/tun_dev.o build/echo.o build/exception.o build/utility.o
$(GPP) -o hans build/tun.o build/sha1.o build/main.o build/client.o build/server.o build/auth.o build/worker.o build/time.o build/tun_dev.o build/echo.o build/exception.o build/utility.o $(LDFLAGS)
tun.o: tun.cpp tun.h exception.h utility.h tun_dev.h
$(GPP) -c tun.cpp $(CFLAGS)
build/utility.o: src/utility.cpp src/utility.h
$(GPP) -c src/utility.cpp -o $@ -o $@ $(CFLAGS)
tun_dev.o:
$(GCC) -c $(TUN_DEV_FILE) -o tun_dev.o $(CFLAGS)
build/exception.o: src/exception.cpp src/exception.h
$(GPP) -c src/exception.cpp -o $@ $(CFLAGS)
sha1.o: sha1.cpp sha1.h
$(GPP) -c sha1.cpp $(CFLAGS)
build/echo.o: src/echo.cpp src/echo.h src/exception.h
$(GPP) -c src/echo.cpp -o $@ $(CFLAGS)
main.o: main.cpp client.h server.h exception.h worker.h auth.h time.h echo.h tun.h tun_dev.h
$(GPP) -c main.cpp $(CFLAGS)
build/tun.o: src/tun.cpp src/tun.h src/exception.h src/utility.h src/tun_dev.h
$(GPP) -c src/tun.cpp -o $@ $(CFLAGS)
client.o: client.cpp client.h server.h exception.h config.h worker.h auth.h time.h echo.h tun.h tun_dev.h
$(GPP) -c client.cpp $(CFLAGS)
build/tun_dev.o:
$(GCC) -c $(TUN_DEV_FILE) -o build/tun_dev.o -o $@ $(CFLAGS)
server.o: server.cpp server.h client.h utility.h config.h worker.h auth.h time.h echo.h tun.h tun_dev.h
$(GPP) -c server.cpp $(CFLAGS)
build/sha1.o: src/sha1.cpp src/sha1.h
$(GPP) -c src/sha1.cpp -o $@ $(CFLAGS)
auth.o: auth.cpp auth.h sha1.h utility.h
$(GPP) -c auth.cpp $(CFLAGS)
build/main.o: src/main.cpp src/client.h src/server.h src/exception.h src/worker.h src/auth.h src/time.h src/echo.h src/tun.h src/tun_dev.h
$(GPP) -c src/main.cpp -o $@ $(CFLAGS)
worker.o: worker.cpp worker.h tun.h exception.h time.h echo.h tun_dev.h config.h
$(GPP) -c worker.cpp $(CFLAGS)
build/client.o: src/client.cpp src/client.h src/server.h src/exception.h src/config.h src/worker.h src/auth.h src/time.h src/echo.h src/tun.h src/tun_dev.h
$(GPP) -c src/client.cpp -o $@ $(CFLAGS)
time.o: time.cpp time.h
$(GPP) -c time.cpp $(CFLAGS)
build/server.o: src/server.cpp src/server.h src/client.h src/utility.h src/config.h src/worker.h src/auth.h src/time.h src/echo.h src/tun.h src/tun_dev.h
$(GPP) -c src/server.cpp -o $@ $(CFLAGS)
build/auth.o: src/auth.cpp src/auth.h src/sha1.h src/utility.h
$(GPP) -c src/auth.cpp -o $@ $(CFLAGS)
build/worker.o: src/worker.cpp src/worker.h src/tun.h src/exception.h src/time.h src/echo.h src/tun_dev.h src/config.h
$(GPP) -c src/worker.cpp -o $@ $(CFLAGS)
build/time.o: src/time.cpp src/time.h
$(GPP) -c src/time.cpp -o $@ $(CFLAGS)
clean:
rm -f tun.o sha1.o main.o client.o server.o auth.o worker.o time.o tun_dev.o echo.o exception.o utility.o tunemu.o hans
rm -f build/tun.o build/sha1.o build/main.o build/client.o build/server.o build/auth.o build/worker.o build/time.o build/tun_dev.o build/echo.o build/exception.o build/utility.o build/tunemu.o hans
rm -df build
tunemu.o: tunemu.h tunemu.c
$(GCC) -c tunemu.c -o tunemu.o
build/tunemu.o: src/tunemu.h src/tunemu.c
$(GCC) -c src/tunemu.c -o build/tunemu.o

14
osflags
View File

@ -8,7 +8,7 @@ ld)
case $OS in
DARWIN)
if [ "$MODE" == TUNEMU ]; then
echo tunemu.o -lpcap
echo build/tunemu.o -lpcap
fi
;;
esac
@ -28,23 +28,23 @@ c)
dev)
case $OS in
LINUX)
echo tun_dev_linux.c
echo src/tun_dev_linux.c
;;
FREEBSD)
echo tun_dev_freebsd.c
echo src/tun_dev_freebsd.c
;;
OPENBSD)
echo tun_dev_openbsd.c
echo src/tun_dev_openbsd.c
;;
DARWIN)
if [ "$MODE" == TUNEMU ]; then
echo tun_dev_darwin_emu.c
echo src/tun_dev_darwin_emu.c
else
echo tun_dev_generic.c
echo src/tun_dev_generic.c
fi
;;
*)
echo tun_dev_generic.c
echo src/tun_dev_generic.c
;;
esac
;;

View File

View File

View File

View File

View File