update windows build

master
steffen 5 years ago
parent 1b795fdb6b
commit d4b300f576

@ -1,37 +1,41 @@
# .SILENT:
.SILENT: help
VERSION=0.1
PREFIX=/usr/local
ETCPREFIX=/etc
# WINLIBS=-lwsock32 -lws2_32
OBJLIB_NAME=UDPTCPNetwork
CXX=g++
CXXFLAGS= -ggdb -fPIC -pg -Wno-write-strings -I./ -std=c++11
# LDFLAGS= -lm -lc -pg -lssl -lcrypto $(WINLIBS)
LDFLAGS= -lm -pg -lssl -lcrypto $(WINLIBS)
-include Makefile.rules
DEFAULT_TCPPORT=6131
DEFAULT_UDPPORT=6131
DEFAULT_SERVER=localhost
OBJLIB=network.o udp.o tcp.o unix.o ssl.o
INCLIB=config.h UDPTCPNetwork.h
OBJLIB_NAME=UDPTCPNetwork
TARGET=lib$(OBJLIB_NAME).so.$(VERSION)
INCLIB=UDPTCPNetwork.h
ifeq ($(TARGET),)
noconfig: help
endif
DISTNAME=libUDPTCPNetwork-$(VERSION)
DEPENDFILE=.depend
all: dep $(TARGET) test-udp test-tcp test-ssl
test-tcp: $(TARGET) test-tcp.o config.h
help:
echo "set up configuration"
echo " make configwindows to generate the windows build"
echo " make configlinux to generate the linix build"
configlinux: clean
cp -f Makefile.rules.linux Makefile.rules
configwindows: clean
cp -f Makefile.rules.windows Makefile.rules
test-tcp: $(TARGET) test-tcp.o
$(CXX) test-tcp.o -o $@ -lUDPTCPNetwork -L./ -I./ $(LDFLAGS)
test-ssl: $(TARGET) test-ssl.o config.h
test-ssl: $(TARGET) test-ssl.o
$(CXX) test-ssl.o -o $@ -lUDPTCPNetwork -L./ -I./ $(LDFLAGS)
test-udp: $(TARGET) test-udp.o config.h
test-udp: $(TARGET) test-udp.o
$(CXX) test-udp.o -o $@ -lUDPTCPNetwork -L./ -I./ $(LDFLAGS)
keygen:
@ -40,7 +44,7 @@ keygen:
install: $(TARGET)
cp -f $(TARGET) $(PREFIX)/lib/
ln -sf $(TARGET) $(PREFIX)/lib/lib$(OBJLIB_NAME).so
if test -f "lib$(OBJLIB_NAME).so"; then cp -f lib$(OBJLIB_NAME).so $(PREFIX)/lib/ ; fi
cp -f UDPTCPNetwork.h $(PREFIX)/include/
uninstall:
@ -51,15 +55,15 @@ uninstall:
rebuild: clean all
$(TARGET): $(OBJLIB) $(INCLIB)
# $(CXX) -shared -Wl,-soname,lib$(OBJLIB_NAME).so -o $(TARGET) $^ -lc $(LDFLAGS)
$(CXX) -shared -Wl,-soname,lib$(OBJLIB_NAME).so -o $(TARGET) $^ $(LDFLAGS)
ln -sf $(TARGET) lib$(OBJLIB_NAME).so
$(CXX) -shared $(LINKPARAMS) -o $(TARGET) $^ $(LDFLAGS)
if test -f "lib$(OBJLIB_NAME).so.$(VERSION)"; then ln -sf $(TARGET) lib$(OBJLIB_NAME).so; fi
ar rcs lib$(OBJLIB_NAME).a $(OBJLIB)
dep:
$(CXX) -MM `ls *.cc` $(CXXFLAGS) > $(DEPENDFILE)
clean:
rm Makefile.rules -rf
rm test-tcp -rf
rm test-udp -rf
rm test-ssl -rf
@ -76,11 +80,6 @@ clean:
rm -rf *.so.*
rm -rf *.pem -rf
cleanall: clean
source: cleanall
config:
echo "#ifndef _CONFIG_H_" > config.h
echo "#define _CONFIG_H_" >> config.h

@ -0,0 +1,16 @@
PREFIX = /usr/local
ETCPREFIX = /etc
LINUXVERSION = 1
CXX = g++
CXXFLAGS = -ggdb -fPIC -pg -Wno-write-strings -I./ -std=c++11 -DBUILD_LINUX
LDFLAGS = -lm -pg -lssl -lcrypto
TARGET = lib$(OBJLIB_NAME).so.$(VERSION)
DISTNAME = lib$(OBJLIB_NAME)-$(VERSION)
DEPENDFILE = .depend
LINKPARAMS = -Wl,-soname,lib$(OBJLIB_NAME).so

@ -0,0 +1,14 @@
VERSION = 0.1
PREFIX = /usr
ETCPREFIX = /etc
WINVERSION = 1
CXX = g++
CXXFLAGS = -ggdb -fPIC -Wno-write-strings -I./ -std=c++11 -DBUILD_WINDOWS
LDFLAGS = -lm -lssl -lcrypto -lwsock32 -lws2_32
TARGET = $(OBJLIB_NAME).dll
DISTNAME = lib$(OBJLIB_NAME)-$(VERSION)
DEPENDFILE = .depend
LINKPARAMS = -Wl,--out-implib,libUDPTCPNetwork.a

@ -1,4 +1,12 @@
# .SILENT:
#
# to build the windows version please install MSYS2
#
# this file should not been used anymore use make configwindows; make ; make install instead
#
#
VERSION=0.1
PREFIX=/usr

Loading…
Cancel
Save