mirror of
https://github.com/norohind/hans.git
synced 2025-04-13 13:17:23 +03:00
Changed directory structure
This commit is contained in:
parent
34acb3f6d5
commit
455da8b0da
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/hans
|
||||||
|
/build
|
69
Makefile
69
Makefile
@ -4,50 +4,59 @@ TUN_DEV_FILE = `sh osflags dev $(MODE)`
|
|||||||
GCC = gcc
|
GCC = gcc
|
||||||
GPP = g++
|
GPP = g++
|
||||||
|
|
||||||
|
.PHONY: directories
|
||||||
|
|
||||||
all: hans
|
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
|
directories: build_dir
|
||||||
$(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)
|
|
||||||
|
|
||||||
utility.o: utility.cpp utility.h
|
build_dir:
|
||||||
$(GPP) -c utility.cpp $(CFLAGS)
|
mkdir -p build
|
||||||
|
|
||||||
exception.o: exception.cpp exception.h
|
tunemu.o: directories build/tunemu.o
|
||||||
$(GPP) -c exception.cpp $(CFLAGS)
|
|
||||||
|
|
||||||
echo.o: echo.cpp echo.h exception.h
|
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) -c echo.cpp $(CFLAGS)
|
$(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
|
build/utility.o: src/utility.cpp src/utility.h
|
||||||
$(GPP) -c tun.cpp $(CFLAGS)
|
$(GPP) -c src/utility.cpp -o $@ -o $@ $(CFLAGS)
|
||||||
|
|
||||||
tun_dev.o:
|
build/exception.o: src/exception.cpp src/exception.h
|
||||||
$(GCC) -c $(TUN_DEV_FILE) -o tun_dev.o $(CFLAGS)
|
$(GPP) -c src/exception.cpp -o $@ $(CFLAGS)
|
||||||
|
|
||||||
sha1.o: sha1.cpp sha1.h
|
build/echo.o: src/echo.cpp src/echo.h src/exception.h
|
||||||
$(GPP) -c sha1.cpp $(CFLAGS)
|
$(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
|
build/tun.o: src/tun.cpp src/tun.h src/exception.h src/utility.h src/tun_dev.h
|
||||||
$(GPP) -c main.cpp $(CFLAGS)
|
$(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
|
build/tun_dev.o:
|
||||||
$(GPP) -c client.cpp $(CFLAGS)
|
$(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
|
build/sha1.o: src/sha1.cpp src/sha1.h
|
||||||
$(GPP) -c server.cpp $(CFLAGS)
|
$(GPP) -c src/sha1.cpp -o $@ $(CFLAGS)
|
||||||
|
|
||||||
auth.o: auth.cpp auth.h sha1.h utility.h
|
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 auth.cpp $(CFLAGS)
|
$(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
|
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 worker.cpp $(CFLAGS)
|
$(GPP) -c src/client.cpp -o $@ $(CFLAGS)
|
||||||
|
|
||||||
time.o: time.cpp time.h
|
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 time.cpp $(CFLAGS)
|
$(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:
|
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
|
||||||
|
|
||||||
|
build/tunemu.o: src/tunemu.h src/tunemu.c
|
||||||
tunemu.o: tunemu.h tunemu.c
|
$(GCC) -c src/tunemu.c -o build/tunemu.o
|
||||||
$(GCC) -c tunemu.c -o tunemu.o
|
|
||||||
|
14
osflags
14
osflags
@ -8,7 +8,7 @@ ld)
|
|||||||
case $OS in
|
case $OS in
|
||||||
DARWIN)
|
DARWIN)
|
||||||
if [ "$MODE" == TUNEMU ]; then
|
if [ "$MODE" == TUNEMU ]; then
|
||||||
echo tunemu.o -lpcap
|
echo build/tunemu.o -lpcap
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -28,23 +28,23 @@ c)
|
|||||||
dev)
|
dev)
|
||||||
case $OS in
|
case $OS in
|
||||||
LINUX)
|
LINUX)
|
||||||
echo tun_dev_linux.c
|
echo src/tun_dev_linux.c
|
||||||
;;
|
;;
|
||||||
FREEBSD)
|
FREEBSD)
|
||||||
echo tun_dev_freebsd.c
|
echo src/tun_dev_freebsd.c
|
||||||
;;
|
;;
|
||||||
OPENBSD)
|
OPENBSD)
|
||||||
echo tun_dev_openbsd.c
|
echo src/tun_dev_openbsd.c
|
||||||
;;
|
;;
|
||||||
DARWIN)
|
DARWIN)
|
||||||
if [ "$MODE" == TUNEMU ]; then
|
if [ "$MODE" == TUNEMU ]; then
|
||||||
echo tun_dev_darwin_emu.c
|
echo src/tun_dev_darwin_emu.c
|
||||||
else
|
else
|
||||||
echo tun_dev_generic.c
|
echo src/tun_dev_generic.c
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo tun_dev_generic.c
|
echo src/tun_dev_generic.c
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user