From 8088e6231e53c04eb5e713983f4971c601581615 Mon Sep 17 00:00:00 2001 From: bergamaschi Date: Mon, 8 Apr 2013 12:40:28 +0000 Subject: [PATCH] virtual servers can be compiled from top directory; include directory with users headers added git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@504 951219d9-93cf-4727-9268-0efd64621fa3 --- slsDetectorSoftware/Makefile | 22 ++++------------- .../gotthardDetectorServer/Makefile.virtual | 24 ++++--------------- slsDetectorSoftware/include/detectorData.h | 1 + .../include/slsDetectorUsers.h | 1 + .../include/slsReceiverUsers.h | 1 + .../mythenDetectorServer/Makefile | 2 +- .../mythenDetectorServer/Makefile.virtual | 18 ++++++++++++++ 7 files changed, 31 insertions(+), 38 deletions(-) create mode 120000 slsDetectorSoftware/include/detectorData.h create mode 120000 slsDetectorSoftware/include/slsDetectorUsers.h create mode 120000 slsDetectorSoftware/include/slsReceiverUsers.h create mode 100755 slsDetectorSoftware/mythenDetectorServer/Makefile.virtual diff --git a/slsDetectorSoftware/Makefile b/slsDetectorSoftware/Makefile index e2a073dee..4057dc87b 100644 --- a/slsDetectorSoftware/Makefile +++ b/slsDetectorSoftware/Makefile @@ -19,15 +19,10 @@ HEADERS = $(SRC_CLNT:.cpp=.h) commonFiles/sls_detector_defs.h slsDetectorAnalysi -SRC_MYTHEN_SVC = mythenDetectorServer/server.c mythenDetectorServer/server_funcs.c mythenDetectorServer/communication_funcs.c mythenDetectorServer/firmware_funcs.c mythenDetectorServer/mcb_funcs.c mythenDetectorServer/trimming_funcs.c - - - DESTDIR ?= bin DOCDIR ?= docs - all: package $(SRC_CLNT) echo "compiling all" @@ -55,24 +50,17 @@ slsDetectorUsersDocs: slsDetectorUsers.doxy slsDetector/slsDetectorUsers.h slsDe doxygen slsDetectorUsers.doxy -mythenServer: $(SRC_MYTHEN_SVC) - $(CC) $(SRC_MYTHEN_SVC) $(CFLAGS) $(FLAGS) $(DFLAGS) $(INCLUDES) -ImythenDetectorServer -DVIRTUAL -lm -D MCB_FUNCS -DC_ONLY -DVERBOSE - mv a.out mythenServer - - -picassoServer: $(SRC_MYTHEN_SVC) - $(CC) $(SRC_MYTHEN_SVC) $(CFLAGS) $(FLAGS) $(DFLAGS) $(INCLUDES) -ImythenDetectorServer -D VIRTUAL -lm -DMCB_FUNCS -DPICASSOD -DC_ONLY - mv a.out picassoServer +mythenVirtualServer: $(SRC_MYTHEN_SVC) + cd mythenDetectorServer && make -f Makefile.virtual DESTDIR=$(DESTDIR) +gotthardVirtualServer: $(SRC_MYTHEN_SVC) + cd gotthardDetectorServer && make -f Makefile.virtual DESTDIR=$(DESTDIR) %.o : %.cpp %.h Makefile $(CXX) -Wall -o $@ -c $< $(INCLUDES) $(DFLAGS) $(FLAGS) -fPIC $(EPICSFLAGS) -L/usr/lib64/ - - - package: $(OBJS) $(DESTDIR)/libSlsDetector.so $(DESTDIR)/libSlsDetector.a $(DESTDIR)/libSlsDetector.so: $(OBJS) @@ -94,6 +82,6 @@ install: package install_inc: $(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR)) - cp -P slsDetector/slsDetectorUsers.h slsDetectorAnalysis/detectorData.h $(DESTDIR) + cp -P slsDetector/slsDetectorUsers.h slsDetectorAnalysis/detectorData.h $(DESTDIR) slsReceiver/slsReceiverUsers.h diff --git a/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual b/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual index 7af0ef403..9eef2f616 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual +++ b/slsDetectorSoftware/gotthardDetectorServer/Makefile.virtual @@ -1,41 +1,25 @@ -# $Id: Makefile,v 1.1.1.1 2006/02/04 03:35:01 freza Exp $ -# first compile -# make cris-axis-linux-gnu +DESTDIR ?= ./ CC = gcc -CFLAGS += -Wall -DMCB_FUNCS -DDACS_INT -DDEBUG -DVIRTUAL #-DVERBOSE -DVERYVERBOSE #-DVIRTUAL #-DDACS_INT_CSERVER +CFLAGS += -Wall -DMCB_FUNCS -DDACS_INT -DDEBUG -DVIRTUAL -PROGS= gotthardDetectorServer -INSTDIR= /tftpboot -INSTMODE= 0777 +PROGS= $(DESTDIR)/gotthardVirtualServer - -BINS = testlib_sharedlibc SRCS = server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c trimming_funcs.c sharedmemory.c OBJS = $(SRCS:%.c=%.o) - +gotthardVirtualServer = $(PROGS) all: clean $(PROGS) -boot: $(OBJS) $(PROGS): $(OBJS) - echo $(OBJS) $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@) -install: $(PROGS) - $(INSTALL) -d $(INSTDIR) - $(INSTALL) -m $(INSTMODE) $(PROGS) $(INSTDIR) - - -romfs: - $(ROMFSINST) /bin/$(PROGS) - clean: rm -rf $(PROGS) *.o *.gdb diff --git a/slsDetectorSoftware/include/detectorData.h b/slsDetectorSoftware/include/detectorData.h new file mode 120000 index 000000000..44205ed04 --- /dev/null +++ b/slsDetectorSoftware/include/detectorData.h @@ -0,0 +1 @@ +../slsDetectorAnalysis/detectorData.h \ No newline at end of file diff --git a/slsDetectorSoftware/include/slsDetectorUsers.h b/slsDetectorSoftware/include/slsDetectorUsers.h new file mode 120000 index 000000000..51e196881 --- /dev/null +++ b/slsDetectorSoftware/include/slsDetectorUsers.h @@ -0,0 +1 @@ +../slsDetector/slsDetectorUsers.h \ No newline at end of file diff --git a/slsDetectorSoftware/include/slsReceiverUsers.h b/slsDetectorSoftware/include/slsReceiverUsers.h new file mode 120000 index 000000000..d73c332c0 --- /dev/null +++ b/slsDetectorSoftware/include/slsReceiverUsers.h @@ -0,0 +1 @@ +../slsReceiver/slsReceiverUsers.h \ No newline at end of file diff --git a/slsDetectorSoftware/mythenDetectorServer/Makefile b/slsDetectorSoftware/mythenDetectorServer/Makefile index 6b7a82671..a82887f95 100755 --- a/slsDetectorSoftware/mythenDetectorServer/Makefile +++ b/slsDetectorSoftware/mythenDetectorServer/Makefile @@ -19,7 +19,7 @@ CFLAGS+= -Wall -DC_ONLY -DMCB_FUNCS -DDACS_INT $(VFLAGS) LDLIBS+= -lm -mythen: $(PROGS) +mythen: clean $(PROGS) all: $(PROGS) boot: $(OBJS) diff --git a/slsDetectorSoftware/mythenDetectorServer/Makefile.virtual b/slsDetectorSoftware/mythenDetectorServer/Makefile.virtual new file mode 100755 index 000000000..f3cb34b21 --- /dev/null +++ b/slsDetectorSoftware/mythenDetectorServer/Makefile.virtual @@ -0,0 +1,18 @@ +DESTDIR?= ./ +PROGS= $(DESTDIR)/mythenVirtualServer + +SRCS= server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c trimming_funcs.c sharedmemory.c + +OBJS= $(SRCS:%.c=%.o) + +CFLAGS+= -Wall -DC_ONLY -DMCB_FUNCS -DDACS_INT $(VFLAGS) -DVIRTUAL -DVERBOSE + +LDLIBS+= -lm +mythenVirtualServer : clean $(PROGS) + +$(PROGS): $(SRCS) + gcc $(LDFLAGS) $(SRCS) $(LDLIBS) $(CFLAGS) -o $@ + +clean: + rm -f *.o $(PROGS) +