2017-08-12 11:36:14 +08:00
|
|
|
cc_cross=/home/wangyu/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
2017-08-13 02:14:50 +08:00
|
|
|
cc_local=g++
|
|
|
|
cc_ar71xx=/home/wangyu/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
|
|
|
cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
|
|
|
FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter
|
|
|
|
SOURCES=main.cpp lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp
|
2017-08-13 10:30:14 +08:00
|
|
|
NAME=udp2raw
|
|
|
|
TAR=${NAME}_binaries.tar.gz ${NAME}_amd64 ${NAME}_x86 ${NAME}_ar71xx ${NAME}_bcm2708
|
2017-08-13 02:14:50 +08:00
|
|
|
|
2017-07-14 21:32:37 +08:00
|
|
|
all:
|
2017-08-13 10:30:14 +08:00
|
|
|
rm -f ${NAME}
|
|
|
|
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
2017-08-05 20:44:48 +08:00
|
|
|
fast:
|
2017-08-13 10:30:14 +08:00
|
|
|
rm -f ${NAME}
|
|
|
|
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt
|
2017-08-13 02:14:50 +08:00
|
|
|
debug:
|
2017-08-13 10:30:14 +08:00
|
|
|
rm -f ${NAME}
|
|
|
|
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -Wformat-nonliteral -D MY_DEBUG
|
2017-07-24 14:22:01 +08:00
|
|
|
|
2017-08-13 02:14:50 +08:00
|
|
|
ar71xx:
|
2017-08-13 10:30:14 +08:00
|
|
|
${cc_ar71xx} -o ${NAME}_ar71xx -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
2017-08-13 02:14:50 +08:00
|
|
|
bcm2708:
|
2017-08-13 10:30:14 +08:00
|
|
|
${cc_bcm2708} -o ${NAME}_bcm2708 -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
2017-08-13 08:18:23 +08:00
|
|
|
amd64:
|
2017-08-13 10:30:14 +08:00
|
|
|
${cc_local} -o ${NAME}_amd64 -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
2017-08-13 08:18:23 +08:00
|
|
|
x86:
|
2017-08-13 10:30:14 +08:00
|
|
|
${cc_local} -o ${NAME}_x86 -I. ${SOURCES} ${FLAGS} -lrt -m32 -static -O3
|
2017-07-14 21:32:37 +08:00
|
|
|
|
2017-08-10 22:08:09 +08:00
|
|
|
cross:
|
2017-08-13 10:30:14 +08:00
|
|
|
${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -O3
|
2017-08-13 02:14:50 +08:00
|
|
|
|
2017-08-12 11:36:14 +08:00
|
|
|
cross2:
|
2017-08-13 10:30:14 +08:00
|
|
|
${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -static -lgcc_eh -O3
|
|
|
|
|
2017-08-13 02:14:50 +08:00
|
|
|
|
2017-08-13 08:18:23 +08:00
|
|
|
release: amd64 x86 ar71xx bcm2708
|
2017-08-13 02:14:50 +08:00
|
|
|
tar -zcvf ${TAR}
|
2017-08-07 13:58:42 +08:00
|
|
|
|
2017-08-13 02:14:50 +08:00
|
|
|
clean:
|
|
|
|
rm -f ${TAR}
|
2017-08-07 13:58:42 +08:00
|
|
|
|