mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
Addition of new makefile scripts.
Addition of the new serialiser (the start anyway). Addition of regression test system. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@249 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e0304cd2de
commit
a89e5a4784
30 changed files with 4700 additions and 0 deletions
29
libretroshare/src/scripts/checks.mk
Normal file
29
libretroshare/src/scripts/checks.mk
Normal file
|
@ -0,0 +1,29 @@
|
|||
#Basic checks
|
||||
|
||||
ifndef RS_TOP_DIR
|
||||
dummy:
|
||||
echo "RS_TOP_DIR is not defined in your makefile"
|
||||
endif
|
||||
|
||||
ifndef SSL_DIR
|
||||
dummy:
|
||||
echo "you must define SSL_DIR before you can compile"
|
||||
|
||||
endif
|
||||
|
||||
ifndef KADC_DIR
|
||||
dummy:
|
||||
echo "you must define KADC_DIR before you can compile"
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(OS),Linux)
|
||||
ifndef PTHREADS_DIR
|
||||
dummy:
|
||||
echo "you must define PTHREADS_DIR before you can compile"
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
95
libretroshare/src/scripts/config-cygwin.mk
Normal file
95
libretroshare/src/scripts/config-cygwin.mk
Normal file
|
@ -0,0 +1,95 @@
|
|||
ifneq ($(OS),Cygwin)
|
||||
dummy:
|
||||
echo "ERROR Cygwin configuration file included, but (OS != Cygwin)
|
||||
|
||||
endif
|
||||
|
||||
############ LINUX CONFIGURATION ########################
|
||||
|
||||
# flags for components....
|
||||
PQI_USE_XPGP = 1
|
||||
PQI_USE_PROXY = 1
|
||||
PQI_USE_CHANNELS = 1
|
||||
USE_FILELOOK = 1
|
||||
|
||||
###########################################################################
|
||||
|
||||
CYGWIN_SRC_ROOT=/cygdrive/c/home/rmfern/prog/MinGW
|
||||
SSL_DIR=$(CYGWIN_SRC_ROOT)/openssl-0.9.7g
|
||||
FLTK_DIR=$(CYGWIN_SRC_ROOT)/FLTK-1.1.6
|
||||
PTHREADS_DIR=$(CYGWIN_SRC_ROOT)/pthreads/pthreads.2
|
||||
KADC_DIR=$(CYGWIN_SRC_ROOT)/debug/KadC-2006-Oct-19
|
||||
ZLIB_DIR=$(CYGWIN_SRC_ROOT)/zlib-1.2.3
|
||||
UPNPC_DIR=$(CYGWIN_SRC_ROOT)/libs/src/miniupnpc-20070515
|
||||
|
||||
include $(RS_TOP_DIR)/scripts/checks.mk
|
||||
|
||||
############ ENFORCE DIRECTORY NAMING ########################
|
||||
|
||||
CC = g++
|
||||
RM = /bin/rm
|
||||
RANLIB = ranlib
|
||||
LIBDIR = $(RS_TOP_DIR)/lib
|
||||
LIBRS = $(LIBDIR)/libretroshare.a
|
||||
|
||||
# Unix: Linux/Cygwin
|
||||
INCLUDE = -I $(RS_TOP_DIR) -I$(KADC_DIR)
|
||||
CFLAGS = -Wall -g $(INCLUDE)
|
||||
|
||||
ifdef PQI_USE_XPGP
|
||||
INCLUDE += -I $(SSL_DIR)/include
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_XPGP
|
||||
CFLAGS += -DPQI_USE_XPGP
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_PROXY
|
||||
CFLAGS += -DPQI_USE_PROXY
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_CHANNELS
|
||||
CFLAGS += -DPQI_USE_CHANNELS
|
||||
endif
|
||||
|
||||
ifdef USE_FILELOOK
|
||||
CFLAGS += -DUSE_FILELOOK
|
||||
endif
|
||||
|
||||
|
||||
RSCFLAGS = -Wall -g $(INCLUDE)
|
||||
|
||||
#########################################################################
|
||||
# OS specific Linking.
|
||||
#########################################################################
|
||||
|
||||
# for static pthread libs....
|
||||
WININC += -DPTW32_STATIC_LIB
|
||||
WININC += -mno-cygwin -mwindows -fno-exceptions
|
||||
WININC += -DWINDOWS_SYS
|
||||
|
||||
WINLIB = -lws2_32 -luuid -lole32 -liphlpapi
|
||||
WINLIB += -lcrypt32
|
||||
|
||||
CFLAGS += -I$(PTHREADS_DIR) $(WININC)
|
||||
CFLAGS += -I$(ZLIB_DIR)
|
||||
|
||||
LIBS = -L$(LIBDIR) -lretroshare
|
||||
ifdef PQI_USE_XPGP
|
||||
LIBS += -L$(SSL_DIR)
|
||||
endif
|
||||
|
||||
LIBS += -lssl -lcrypto
|
||||
LIBS += -L$(KADC_DIR) -lKadC
|
||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
||||
LIBS += -L$(ZLIB_DIR) -lz
|
||||
|
||||
RSLIBS += $(LIBS)
|
||||
RSLIBS += -L$(PTHREADS_DIR) -lpthreadGC2d
|
||||
|
||||
RSLIBS += $(WINLIB)
|
||||
LIBS += $(WINLIB)
|
||||
|
||||
RSCFLAGS += $(WININC)
|
||||
|
||||
|
72
libretroshare/src/scripts/config-linux.mk
Normal file
72
libretroshare/src/scripts/config-linux.mk
Normal file
|
@ -0,0 +1,72 @@
|
|||
|
||||
ifneq ($(OS),Linux)
|
||||
dummy:
|
||||
echo "ERROR Linux configuration file included, but (OS != Linux)
|
||||
|
||||
endif
|
||||
|
||||
############ LINUX CONFIGURATION ########################
|
||||
|
||||
# flags for components....
|
||||
PQI_USE_XPGP = 1
|
||||
PQI_USE_PROXY = 1
|
||||
PQI_USE_CHANNELS = 1
|
||||
USE_FILELOOK = 1
|
||||
|
||||
SSL_DIR=../../../../../src/openssl-0.9.7g-xpgp-0.1c
|
||||
KADC_DIR=../../../../../src/KadC
|
||||
UPNPC_DIR=../../../../../src/miniupnpc-20070515
|
||||
|
||||
include $(RS_TOP_DIR)/scripts/checks.mk
|
||||
|
||||
############ ENFORCE DIRECTORY NAMING ########################
|
||||
|
||||
CC = g++
|
||||
RM = /bin/rm
|
||||
RANLIB = ranlib
|
||||
LIBDIR = $(RS_TOP_DIR)/lib
|
||||
LIBRS = $(LIBDIR)/libretroshare.a
|
||||
|
||||
# Unix: Linux/Cygwin
|
||||
INCLUDE = -I $(RS_TOP_DIR) -I$(KADC_DIR)
|
||||
CFLAGS = -Wall -g $(INCLUDE)
|
||||
|
||||
ifdef PQI_USE_XPGP
|
||||
INCLUDE += -I $(SSL_DIR)/include
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_XPGP
|
||||
CFLAGS += -DPQI_USE_XPGP
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_PROXY
|
||||
CFLAGS += -DPQI_USE_PROXY
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_CHANNELS
|
||||
CFLAGS += -DPQI_USE_CHANNELS
|
||||
endif
|
||||
|
||||
ifdef USE_FILELOOK
|
||||
CFLAGS += -DUSE_FILELOOK
|
||||
endif
|
||||
|
||||
|
||||
RSCFLAGS = -Wall -g $(INCLUDE)
|
||||
|
||||
#########################################################################
|
||||
# OS specific Linking.
|
||||
#########################################################################
|
||||
|
||||
LIBS = -L$(LIBDIR) -lretroshare
|
||||
ifdef PQI_USE_XPGP
|
||||
LIBS += -L$(SSL_DIR)
|
||||
endif
|
||||
LIBS += -lssl -lcrypto -lpthread
|
||||
LIBS += -L$(KADC_DIR) -lKadC
|
||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
||||
LIBS += $(XLIB) -ldl -lz
|
||||
|
||||
RSLIBS = $(LIBS)
|
||||
|
||||
|
249
libretroshare/src/scripts/config-mingw.mk
Normal file
249
libretroshare/src/scripts/config-mingw.mk
Normal file
|
@ -0,0 +1,249 @@
|
|||
####
|
||||
#Define OS.
|
||||
#
|
||||
OS = Linux
|
||||
#OS = Cygwin
|
||||
#OS = Win # MinGw.
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
###########################################################################
|
||||
###########################################################################
|
||||
# Please Define these Variables before Compiling. (Examples below:)
|
||||
# Linux (SSL_DIR & KADC_DIR)
|
||||
# Cygwin (SSL_DIR & KADC_DIR & FLTK_DIR & PTHREADS_DIR)
|
||||
# MinGW (SSL_DIR & KADC_DIR & FLTK_DIR & PTHREADS_DIR)
|
||||
|
||||
#### Linux/Cygwin Parameters.
|
||||
#SSL_DIR=/home/xxx/prog/src/openssl-0.9.7g-xpgp-0.1c
|
||||
#KADC_DIR=/home/xxx/prog/src/KadC
|
||||
#
|
||||
#### Cygwin Only....
|
||||
#FLTK_DIR=/MinGWlibs/FLTK-1.1.6
|
||||
#PTHREADS_DIR=/cygdrive/c/home/dev/prog/MinGw/pthreads/Pre-built.2
|
||||
#KADC_DIR=/cygdrive/c/home/dev/prog/MinGW/KadC
|
||||
#ZLIB_DIR=/cygdrive/c/home/dev/prog/MinGW/zlib-1.2.3
|
||||
#
|
||||
###########################################################################
|
||||
# My Versions
|
||||
ifeq ($(OS),Linux)
|
||||
#Linux.
|
||||
SSL_DIR=../../../../../src/openssl-0.9.7g-xpgp-0.1c
|
||||
KADC_DIR=../../../../../src/KadC
|
||||
UPNPC_DIR=../../../../../src/miniupnpc-20070515
|
||||
else
|
||||
###########################################################################
|
||||
ifeq ($(OS),Cygwin)
|
||||
|
||||
#Cygwin....
|
||||
CYGWIN_SRC_ROOT=/cygdrive/c/home/rmfern/prog/MinGW
|
||||
SSL_DIR=/home/rmfern/prog/src/openssl-0.9.7g
|
||||
#SSL_DIR=$(CYGWIN_SRC_ROOT)/openssl-0.9.7g
|
||||
FLTK_DIR=$(CYGWIN_SRC_ROOT)/FLTK-1.1.6
|
||||
PTHREADS_DIR=$(CYGWIN_SRC_ROOT)/pthreads/pthreads.2
|
||||
KADC_DIR=$(CYGWIN_SRC_ROOT)/debug/KadC-2006-Oct-19
|
||||
ZLIB_DIR=$(CYGWIN_SRC_ROOT)/zlib-1.2.3
|
||||
UPNPC_DIR=$(CYGWIN_SRC_ROOT)/libs/src/miniupnpc-20070515
|
||||
|
||||
else
|
||||
|
||||
#MinGw....
|
||||
MINGW_SRC_ROOT=c:\home\rmfern\prog\MinGW
|
||||
SSL_DIR=$(MINGW_SRC_ROOT)\openssl-0.9.7g
|
||||
FLTK_DIR=$(MINGW_SRC_ROOT)\FLTK-1.1.6
|
||||
PTHREADS_DIR=$(MINGW_SRC_ROOT)\pthreads\pthreads.2
|
||||
KADC_DIR=$(MINGW_SRC_ROOT)\debug\KadC-2006-Oct-19
|
||||
ZLIB_DIR=$(MINGW_SRC_ROOT)\zlib-1.2.3
|
||||
UPNPC_DIR=$(MINGW_SRC_ROOT)\miniupnpc-20070515
|
||||
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
endif
|
||||
###########################################################################
|
||||
|
||||
ifndef RS_TOP_DIR
|
||||
dummy:
|
||||
echo "RS_TOP_DIR is not defined in your makefile"
|
||||
endif
|
||||
|
||||
RS_DIR=$(RS_TOP_DIR)
|
||||
|
||||
ifndef SSL_DIR
|
||||
dummy:
|
||||
echo "you must define SSL_DIR before you can compile"
|
||||
|
||||
endif
|
||||
|
||||
ifndef KADC_DIR
|
||||
dummy:
|
||||
echo "you must define KADC_DIR before you can compile"
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(OS),Linux)
|
||||
# no longer dependancy
|
||||
# ifndef FLTK_DIR
|
||||
#dummy:
|
||||
# echo "you must define FLTK_DIR before you can compile"
|
||||
|
||||
# endif
|
||||
#
|
||||
ifndef PTHREADS_DIR
|
||||
dummy:
|
||||
echo "you must define PTHREADS_DIR before you can compile"
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
############ ENFORCE DIRECTORY NAMING ########################
|
||||
|
||||
CC = g++
|
||||
|
||||
|
||||
# flags for components....
|
||||
PQI_USE_XPGP = 1
|
||||
PQI_USE_PROXY = 1
|
||||
#PQI_USE_CHANNELS = 1
|
||||
USE_FILELOOK = 1
|
||||
|
||||
ifeq ($(OS),Win)
|
||||
# MinGw
|
||||
INCLUDE = -I $(RS_DIR) -I$(KADC_DIR)
|
||||
ifdef PQI_USE_XPGP
|
||||
INCLUDE += -I $(SSL_DIR)\include
|
||||
endif
|
||||
else
|
||||
# Unix: Linux/Cygwin
|
||||
INCLUDE = -I $(RS_DIR) -I$(KADC_DIR)
|
||||
ifdef PQI_USE_XPGP
|
||||
INCLUDE += -I $(SSL_DIR)/include
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS = -Wall -g $(INCLUDE)
|
||||
|
||||
RANLIB = ranlib
|
||||
LIBRS = ../lib/libretroshare.a
|
||||
RSCFLAGS = -Wall -g $(INCLUDE)
|
||||
|
||||
ifdef PQI_USE_XPGP
|
||||
CFLAGS += -DPQI_USE_XPGP
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_PROXY
|
||||
CFLAGS += -DPQI_USE_PROXY
|
||||
endif
|
||||
|
||||
ifdef PQI_USE_CHANNELS
|
||||
CFLAGS += -DPQI_USE_CHANNELS
|
||||
endif
|
||||
|
||||
ifdef USE_FILELOOK
|
||||
CFLAGS += -DUSE_FILELOOK
|
||||
endif
|
||||
|
||||
|
||||
#########################################################################
|
||||
# OS specific Includes/Libs.
|
||||
# LINUX...
|
||||
ifeq ($(OS),Linux)
|
||||
|
||||
|
||||
# XLIBS arent needed for basic libretroshare.
|
||||
# only needed for FLTK interface.
|
||||
|
||||
#XLIB = -lXft -lpthread -lXext -lX11 \
|
||||
# -lXrender -lexpat -L/usr/X11R6/lib -lXau \
|
||||
# -lXinerama -lXdmcp -lXext \
|
||||
# -lfontconfig -lfreetype -lz
|
||||
|
||||
RM = /bin/rm
|
||||
|
||||
LIBDIR = $(RS_DIR)/lib
|
||||
LIBS = -L$(LIBDIR) -lretroshare
|
||||
ifdef PQI_USE_XPGP
|
||||
LIBS += -L$(SSL_DIR)
|
||||
endif
|
||||
LIBS += -lssl -lcrypto -lpthread
|
||||
LIBS += -L$(KADC_DIR) -lKadC
|
||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
||||
LIBS += $(XLIB) -ldl -lz
|
||||
|
||||
RSLIBS = $(LIBS)
|
||||
|
||||
else # windows (Cygwin or MinGW)
|
||||
|
||||
# for static pthread libs....
|
||||
WININC += -DPTW32_STATIC_LIB
|
||||
WINLIB = -lws2_32 -luuid -lole32 -liphlpapi
|
||||
|
||||
ifeq ($(OS),Cygwin)
|
||||
# Cygwin
|
||||
WININC += -mno-cygwin -mwindows -fno-exceptions -fomit-frame-pointer -DWINDOWS_SYS
|
||||
WINLIB += -lcrypt32
|
||||
|
||||
# Cygwin
|
||||
#CFLAGS += -I$(FLTK_DIR)/include
|
||||
CFLAGS += -I$(PTHREADS_DIR) $(WININC)
|
||||
CFLAGS += -I$(ZLIB_DIR)
|
||||
|
||||
LIBDIR = $(RS_DIR)/lib
|
||||
LIBS = -L$(LIBDIR) -lretroshare
|
||||
ifdef PQI_USE_XPGP
|
||||
LIBS += -L$(SSL_DIR)
|
||||
endif
|
||||
LIBS += -lssl -lcrypto
|
||||
LIBS += -L$(KADC_DIR) -lKadC
|
||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
||||
LIBS += -L$(ZLIB_DIR) -lz
|
||||
|
||||
RSLIBS += $(LIBS)
|
||||
RSLIBS += -L$(PTHREADS_DIR) -lpthreadGC2d
|
||||
|
||||
RSLIBS += $(WINLIB)
|
||||
LIBS += $(WINLIB)
|
||||
|
||||
|
||||
RSCFLAGS += $(WININC)
|
||||
|
||||
RM = /bin/rm
|
||||
|
||||
else # MinGw.
|
||||
|
||||
#WININC += -mwindows -fno-exceptions -fomit-frame-pointer -DWINDOWS_SYS
|
||||
WININC += -frtti -fexceptions -DWINDOWS_SYS
|
||||
WINLIB += -lcrypt32-cygwin
|
||||
|
||||
# Cygwin
|
||||
CFLAGS += -I$(PTHREADS_DIR) $(WININC)
|
||||
CFLAGS += -I$(ZLIB_DIR)
|
||||
#CFLAGS += -I$(FLTK_DIR)\include
|
||||
|
||||
LIBDIR = $(RS_DIR)\lib
|
||||
LIBS = -L$(LIBDIR) -lretroshare
|
||||
ifdef PQI_USE_XPGP
|
||||
LIBS += -L$(SSL_DIR)
|
||||
endif
|
||||
LIBS += -lssl -lcrypto
|
||||
LIBS += -L$(KADC_DIR) -lKadC
|
||||
LIBS += -L$(UPNPC_DIR) -lminiupnpc
|
||||
LIBS += -L$(ZLIB_DIR) -lz
|
||||
|
||||
RSLIBS = $(LIBS)
|
||||
RSLIBS += -L$(PTHREADS_DIR) -lpthreadGC2d
|
||||
|
||||
LIBS += $(WINLIB)
|
||||
RSLIBS += $(WINLIB)
|
||||
|
||||
|
||||
RSCFLAGS += $(WININC)
|
||||
|
||||
RM = del
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
22
libretroshare/src/scripts/config.mk
Normal file
22
libretroshare/src/scripts/config.mk
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
# determine which operating system
|
||||
#
|
||||
###########################################################################
|
||||
#Define OS.
|
||||
#
|
||||
OS = Linux
|
||||
#OS = Cygwin
|
||||
#OS = Win # MinGw.
|
||||
###########################################################################
|
||||
|
||||
ifeq ($(OS),Linux)
|
||||
include $(RS_TOP_DIR)/scripts/config-linux.mk
|
||||
else
|
||||
ifeq ($(OS),Cygwin)
|
||||
include $(RS_TOP_DIR)/scripts/config-cygwin.mk
|
||||
else
|
||||
include $(RS_TOP_DIR)/scripts/config-mingw.mk
|
||||
endif
|
||||
endif
|
||||
|
||||
###########################################################################
|
25
libretroshare/src/scripts/regress.mk
Normal file
25
libretroshare/src/scripts/regress.mk
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
testoutputfiles = $(foreach tt,$(1),$(tt).tstout)
|
||||
|
||||
%.tstout : %.sh
|
||||
-sh ./$< > $@ 2>&1
|
||||
|
||||
%.tstout : %
|
||||
-./$< > $@ 2>&1
|
||||
|
||||
TESTOUT = $(call testoutputfiles,$(TESTS))
|
||||
|
||||
.phony : tests regress retest clobber
|
||||
|
||||
tests: $(TESTS)
|
||||
|
||||
regress: $(TESTOUT)
|
||||
@-echo "--------------- SUCCESS (count):"
|
||||
@-grep -c SUCCESS $(TESTOUT)
|
||||
@-echo "--------------- FAILURE REPORTS:"
|
||||
@-grep FAILURE $(TESTOUT) || echo no failures
|
||||
@-echo "--------------- end"
|
||||
|
||||
retest:
|
||||
-/bin/rm $(TESTOUT)
|
||||
|
23
libretroshare/src/scripts/rules.mk
Normal file
23
libretroshare/src/scripts/rules.mk
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
# defines required / used.
|
||||
#
|
||||
# CFLAGS
|
||||
#
|
||||
#
|
||||
|
||||
librs: $(RSOBJ)
|
||||
$(AR) r $(LIBRS) $(RSOBJ)
|
||||
$(RANLIB) $(LIBRS)
|
||||
|
||||
.cc.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
clean:
|
||||
-/bin/rm $(RSOBJ) $(EXECOBJ) $(TESTOBJ)
|
||||
|
||||
clobber: clean retest
|
||||
-/bin/rm $(EXEC) $(TESTS)
|
||||
|
||||
|
||||
include $(RS_TOP_DIR)/scripts/regress.mk
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue