From f603985860e7987735b9380d0d7a9967838ddac4 Mon Sep 17 00:00:00 2001 From: zolliker Date: Tue, 8 Mar 2005 11:11:51 +0000 Subject: [PATCH] - cleaned up makefiles - polished code to avoid warnings SKIPPED: psi/amorscan.c psi/amorstat.c psi/buffer.c psi/dornier2.c psi/ecb.c psi/ecbdriv.c psi/el737hpdriv.c psi/el737hpv2driv.c psi/eve.c psi/faverage.c psi/fowrite.c psi/ipsdriv.c psi/logger.c psi/make_gen psi/makefile psi/makefile_alpha psi/makefile_linux psi/oicom.c psi/psi.c psi/remob.c psi/ruli.c psi/tasinit.c psi/tasscan.c psi/tasutil.c psi/tricssupport.c psi/hardsup/itc4util.c psi/hardsup/make_gen psi/hardsup/makefile psi/hardsup/makefile_alpha psi/hardsup/makefile_linux psi/hardsup/makeprint.c psi/hardsup/serialsinq.c psi/tecs/coc_client.c psi/tecs/coc_logfile.c psi/tecs/coc_server.c psi/tecs/coc_server.h psi/tecs/didi psi/tecs/keep_running.c psi/tecs/macosx_def psi/tecs/make_crv.tcsh psi/tecs/make_gen psi/tecs/makefile psi/tecs/makefile_linux psi/tecs/makefile_macosx psi/tecs/myc_buf.c psi/tecs/myc_time.c psi/tecs/six.c psi/tecs/sys_select.c psi/tecs/tecs.c psi/tecs/tecs_cli.c psi/tecs/tecs_data.c psi/tecs/tecs_lsc.c psi/tecs/tecs_serial.c psi/tecs/term.c psi/utils/SerPortServer.c psi/utils/el734.c psi/utils/make_gen psi/utils/makefile psi/utils/makefile_alpha psi/utils/makefile_linux --- alpha_def | 4 ++-- linux_def | 4 ++-- make_gen | 23 ++++++++++++++--------- make_gen_dummy | 3 --- makefile | 24 +----------------------- makefile_alpha | 2 +- makefile_alpha_dummy | 2 +- makefile_linux | 11 +++-------- makefile_linux_dummy | 6 +++--- makefile_slinux | 11 +++-------- napi.c | 4 ++-- napi5.c | 6 +++++- nxdict.c | 2 +- sllinux_def | 4 ++-- 14 files changed, 40 insertions(+), 66 deletions(-) diff --git a/alpha_def b/alpha_def index 1d963678..6af0c8f6 100644 --- a/alpha_def +++ b/alpha_def @@ -5,11 +5,11 @@ #========================================================================== # the following lines only for fortified version -#DFORTIFY=-DFORTIFY -I$(ROOT)/$(SRC) +#DFORTIFY=-DFORTIFY #FORTIFYOBJ=strdup.o fortify.o #----------------select proper Makefile -MFLAGS= -f $(SRC)makefile_alpha$(DUMMY) SRC=$(SRC) +MFLAGS= -f makefile_alpha$(DUMMY) #------------- path to HDF installation HDFROOT=/afs/psi.ch/project/sinq/tru64 diff --git a/linux_def b/linux_def index 0429456f..ea3a5a18 100644 --- a/linux_def +++ b/linux_def @@ -4,9 +4,9 @@ # Mark Koennecke, July 2003 #------------------------------------------------------------------------- -#DFORTIFY= -DFORTIFY -I$(ROOT)/$(SRC) +#DFORTIFY= -DFORTIFY #FORTIFYOBJ= fortify.o strdup.o -MFLAGS=-f $(SRC)makefile_linux$(DUMMY) SRC=$(SRC) +MFLAGS=-f makefile_linux$(DUMMY) HDFROOT=/afs/psi.ch/project/sinq/linux diff --git a/make_gen b/make_gen index a0edc873..887afd3d 100644 --- a/make_gen +++ b/make_gen @@ -5,9 +5,6 @@ # Markus Zolliker March 2003 #--------------------------------------------------------------------------- -VPATH=$(SRC) -ROOT=. - COBJ = Sclient.o network.o ifile.o intcli.o $(FORTIFYOBJ) SOBJ = network.o ifile.o conman.o SCinter.o splitter.o passwd.o \ servlog.o sicvar.o nserver.o SICSmain.o \ @@ -40,10 +37,10 @@ VELOOBJ = velo.o velosim.o .SUFFIXES: .SUFFIXES: .tcl .htm .c .o -all: SICServer +all: SICServer libmat libhlib libtecsl libpsi # use this target when some of the libraries SUBLIBS might be incomplete -full: purge SICServer +full: purge all SICServer: $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) \ $(VELOOBJ) $(DIFIL) $(EXTRA) \ @@ -52,16 +49,24 @@ SICServer: $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) \ $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) \ $(VELOOBJ) $(DIFOBJ) $(EXTRA) $(LIBS) -matrix/libmatrix.a: +matrix/libmatrix.a: libmat + +libmat: cd matrix; make $(MFLAGS) libmatrix.a -psi/hardsup/libhlib.a: +psi/hardsup/libhlib.a: libhlib + +libhlib: cd psi/hardsup; make $(MFLAGS) libhlib.a -psi/tecs/libtecsl.a: +psi/tecs/libtecsl.a: libtecsl + +libtecsl: cd psi/tecs; make $(MFLAGS) libtecsl.a -psi/libpsi.a: +psi/libpsi.a: libpsi + +libpsi: cd psi; make $(MFLAGS) libpsi.a purge: diff --git a/make_gen_dummy b/make_gen_dummy index 7af54a64..7cedb9d4 100644 --- a/make_gen_dummy +++ b/make_gen_dummy @@ -5,9 +5,6 @@ # Markus Zolliker March 2003 #--------------------------------------------------------------------------- -VPATH=$(SRC) -ROOT=. - COBJ = Sclient.o network.o ifile.o intcli.o $(FORTIFYOBJ) SOBJ = network.o ifile.o conman.o SCinter.o splitter.o passwd.o \ servlog.o sicvar.o nserver.o SICSmain.o \ diff --git a/makefile b/makefile index 8f5a8ebc..66edfc10 100644 --- a/makefile +++ b/makefile @@ -1,15 +1,6 @@ -# Forwards the execution to a version specific makefile. -# SICS_VERSION must be defined, else usage is printed # M. Zolliker 03.2005 -VERS_UNDEFINED= -VERS_UNDEFINED$(SICS_VERSION)=version_undefined - -INCL_MF=makefile_$(SICS_VERSION) - --include $(INCL_MF) - -version_undefined: +default: @ echo "" @ echo "Usage:" @ echo "" @@ -18,17 +9,4 @@ version_undefined: @ echo ' where makefile_xxx is one of' @ echo "" @ ls -1 makefile_* | pr -t -o 4 - @ echo "" - @ echo "Or, more convenient, define the following in the login script" - @ echo "" - @ echo " setenv SICS_VERSION version_xxx (assume we are using tcsh)" - @ echo "" - @ echo " where version_xxx is one of" - @ echo "" - @ ls -1 makefile_* | cut -b 10-99 | pr -t -o 4 - @ echo "" - @ echo "and then use simply" - @ echo "" - @ echo " make [target]" - @ echo "" diff --git a/makefile_alpha b/makefile_alpha index 463b728f..d85e5e0a 100644 --- a/makefile_alpha +++ b/makefile_alpha @@ -15,7 +15,7 @@ include alpha_def CC = cc CFLAGS = -I$(HDFROOT)/include $(DFORTIFY) -DHDF4 -DHDF5 \ - -I$(SRC). -I$(SRC)psi/hardsup \ + -Ipsi/hardsup -I. \ -g -std1 -warnprotos BINTARGET = bin EXTRA= diff --git a/makefile_alpha_dummy b/makefile_alpha_dummy index e1336fc4..7e122c71 100644 --- a/makefile_alpha_dummy +++ b/makefile_alpha_dummy @@ -12,7 +12,7 @@ include alpha_def HDFROOT=/data/lnslib CC = cc -CFLAGS = -I$(HDFROOT)/include -I$(SRC). $(DFORTIFY) -DHDF4 -DHDF5 \ +CFLAGS = -I$(HDFROOT)/include $(DFORTIFY) -DHDF4 -DHDF5 \ -g -std1 -warnprotos BINTARGET = bin EXTRA= diff --git a/makefile_linux b/makefile_linux index c98d0c92..5dd940c6 100644 --- a/makefile_linux +++ b/makefile_linux @@ -11,16 +11,11 @@ NI= -DHAVENI NIOBJ= nigpib.o NILIB=$(SINQDIR)/linux/lib/cib.o -# The variable SRC is needed for the case, where source and objects are -# separated. In the case where objects are mixed up with sources, SRC -# is assumed to be empty and does not harm. I case of problems -# please ask Markus Zolliker. - -include $(SRC)linux_def +include linux_def CC = gcc CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) \ - -I$(SRC)psi/hardsup -I$(SRC). \ + -Ipsi/hardsup -I. \ -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) BINTARGET = bin @@ -32,7 +27,7 @@ LIBS = -static -L$(HDFROOT)/lib $(SUBLIBS) $(NILIB)\ $(HDFROOT)/lib/libmfhdf.a $(HDFROOT)/lib/libdf.a \ $(HDFROOT)/lib/libjpeg.a -ldl -lz -lm -lc -include $(SRC)make_gen +include make_gen diff --git a/makefile_linux_dummy b/makefile_linux_dummy index 6c684e16..46d9c7fb 100644 --- a/makefile_linux_dummy +++ b/makefile_linux_dummy @@ -11,10 +11,10 @@ #NILIB=-lgpibenet DUMMY=_dummy -include $(SRC)linux_def +include linux_def CC = gcc -CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -I$(SRC). \ +CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) \ -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) HDFROOT=/afs/psi.ch/project/sinq/linux @@ -26,7 +26,7 @@ LIBS = -L$(HDFROOT)/lib $(SUBLIBS) \ $(HDFROOT)/lib/libjpeg.a -lz -lm -ll -lc -include $(SRC)make_gen_dummy +include make_gen_dummy diff --git a/makefile_slinux b/makefile_slinux index 0c8d93ed..37382d79 100644 --- a/makefile_slinux +++ b/makefile_slinux @@ -11,16 +11,11 @@ NI= -DHAVENI NIOBJ= nigpib.o NILIB=$(SINQDIR)/linux/lib/cib.o -# The variable SRC is needed for the case, where source and objects are -# separated. In the case where objects are mixed up with sources, SRC -# is assumed to be empty and does not harm. I case of problems -# please ask Markus Zolliker. - -include $(SRC)sllinux_def +include sllinux_def CC = gcc CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) \ - -I$(SRC)psi/hardsup -I$(SRC). \ + -Ipsi/hardsup -I. \ -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) \ -Wall -Wno-unused -Wno-comment -Wno-switch @@ -33,7 +28,7 @@ LIBS = -L$(HDFROOT)/lib $(SUBLIBS) $(NILIB)\ $(HDFROOT)/lib/libmfhdf.a $(HDFROOT)/lib/libdf.a \ $(HDFROOT)/lib/libjpeg.a -lsz -ldl -lz -lm -lc -include $(SRC)make_gen +include make_gen diff --git a/napi.c b/napi.c index 035325d8..b7410d6b 100644 --- a/napi.c +++ b/napi.c @@ -23,7 +23,7 @@ ----------------------------------------------------------------------------*/ -static const char* rscid = "$Id: napi.c,v 1.8 2004/11/17 10:50:16 cvs Exp $"; /* Revision interted by CVS */ +static const char* rscid = "$Id: napi.c,v 1.9 2005/03/08 11:11:51 zolliker Exp $"; /* Revision interted by CVS */ #include #include @@ -85,7 +85,7 @@ NXstatus CALLING_STYLE NXsetcache(long newVal) /*---------------------------------------------------------------------*/ - static void NXNXNXReportError(void *pData, char *string) + void NXNXNXReportError(void *pData, char *string) { printf("%s \n",string); } diff --git a/napi5.c b/napi5.c index 482417c7..6d8c0330 100644 --- a/napi5.c +++ b/napi5.c @@ -128,7 +128,11 @@ NXstatus CALLING_STYLE NX5closegroup (NXhandle fid); unsigned int vers_major, vers_minor, vers_release, am1 ; hid_t fapl; int mdc_nelmts; - unsigned long rdcc_nelmts; +#ifdef H5_WANT_H5_V1_4_COMPAT + unsigned int rdcc_nelmts; +#else + size_t rdcc_nelmts; +#endif size_t rdcc_nbytes; double rdcc_w0; diff --git a/nxdict.c b/nxdict.c index f766a138..c7e2af95 100644 --- a/nxdict.c +++ b/nxdict.c @@ -593,7 +593,7 @@ /*------------------- The Defintion String Parser -----------------------*/ /*------- Data structures */ typedef struct { - char pText[20]; + char *pText; int iCode; } TokDat; #define TERMSDS 100 diff --git a/sllinux_def b/sllinux_def index 66a6cc3c..ea98bcdb 100644 --- a/sllinux_def +++ b/sllinux_def @@ -4,9 +4,9 @@ # Mark Koennecke, July 2003 #------------------------------------------------------------------------- -#DFORTIFY= -DFORTIFY -I$(ROOT)/$(SRC) +#DFORTIFY= -DFORTIFY #FORTIFYOBJ= fortify.o strdup.o -MFLAGS=-f $(SRC)makefile_linux$(DUMMY) SRC=$(SRC) +MFLAGS=-f makefile_linux$(DUMMY) HDFROOT=/afs/psi.ch/project/sinq/sl-linux