From d62d2902ac2276715612b5f7387a012ac41a5231 Mon Sep 17 00:00:00 2001 From: cvs Date: Mon, 6 Oct 2003 12:40:04 +0000 Subject: [PATCH] changed makefile structure M.Z. --- utils/Makefile | 72 ------------------------------------------- utils/SerPortServer.c | 4 +-- utils/cd_obj | 1 + utils/make_gen | 50 ++++++++++++++++++++++++++++++ utils/makefile | 8 +++++ utils/makefile_alpha | 26 ++++++++++++++++ utils/makefile_linux | 25 +++++++++++++++ 7 files changed, 112 insertions(+), 74 deletions(-) delete mode 100644 utils/Makefile create mode 100644 utils/cd_obj create mode 100644 utils/make_gen create mode 100644 utils/makefile create mode 100644 utils/makefile_alpha create mode 100644 utils/makefile_linux diff --git a/utils/Makefile b/utils/Makefile deleted file mode 100644 index bbff3c8..0000000 --- a/utils/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -#--------------------------------------------------------------------------- -# Makefile for the Utilities in the utils directory, -# -# e.g. SerPortServer asynsrv_test -# -# David Maden, Sep-2000 -#-------------------------------------------------------------------------- - -#------------ for DigitalUnix (add -DFORTIFY to CFLAGS for fortified version) -#CC = cc -#CFLAGS = -std -g -warnprotos -I. -I../hardsup -#BIN = ../bin -#LFLAGS = -L../hardsup - -#------------ for Linux -CC = gcc -CFLAGS = -g -I. -I../hardsup -DLinux -BIN = ../bin -LFLAGS = -L../hardsup -L/usr/X11R6/lib -#------------ - -#---------------------------------------------------------- - -all: $(BIN)/asynsrv_test \ - $(BIN)/el734 \ - $(BIN)/el734_test \ - $(BIN)/el737 \ - $(BIN)/SerPortServer - -#---------------------------------------------------------- - -$(BIN)/SerPortServer: SerPortServer.c - rm -f $(BIN)/SerPortServer - $(CC) $(CFLAGS) -o $(BIN)/SerPortServer \ - SerPortServer.c $(LFLAGS) -lhlib -lX11 - - -$(BIN)/asynsrv_test: asynsrv_test.c - rm -f $(BIN)/asynsrv_test - $(CC) $(CFLAGS) -o $(BIN)/asynsrv_test \ - asynsrv_test.c $(LFLAGS) -lhlib -lX11 - -$(BIN)/el734: el734.c - @ echo "el734 needs Motif library. Not yet found on linux" - rm -f $(BIN)/el734 - $(CC) $(CFLAGS) -o $(BIN)/el734 \ - el734.c $(LFLAGS) -lhlib -lX11 -lXt -lXm - -$(BIN)/el734_test: el734_test.c - rm -f $(BIN)/el734_test - $(CC) $(CFLAGS) -o $(BIN)/el734_test \ - el734_test.c $(LFLAGS) -lhlib -lX11 - -$(BIN)/el737: el737.c - @ echo "el737 needs Motif library. Not yet found on linux" - rm -f $(BIN)/el737 - $(CC) $(CFLAGS) -I/usr/X11R6/include -o $(BIN)/el737 \ - el737.c $(LFLAGS) -lhlib -lXm -lXt -lX11 -lm - -#---------------------------------------------------------- - -clean: - - rm -f *.o - - rm -f $(BIN)/SerPortServer \ - $(BIN)/asynsrv_test \ - $(BIN)/el734 \ - $(BIN)/el734_test \ - $(BIN)/el737 -#---------------------------------------------------------- -.c.o: - $(CC) $(CFLAGS) -c $*.c -#---------------------------------------------------------- diff --git a/utils/SerPortServer.c b/utils/SerPortServer.c index 40cf050..748a86b 100755 --- a/utils/SerPortServer.c +++ b/utils/SerPortServer.c @@ -1334,7 +1334,7 @@ static int RS__MAX_ASYNCH = 20; /* Asynch "ports" 0 - 19 will be allowed */ int tcp_option = UCX$C_TCP_PROBE_IDLE; #else int oto_len; - #ifdef Linux + #ifdef LINUX int tcp_option = 0; #else int tcp_option = TCP_KEEPINIT; @@ -2414,7 +2414,7 @@ static int RS__MAX_ASYNCH = 20; /* Asynch "ports" 0 - 19 will be allowed */ for (;;) { fflush (NULL); -#ifdef Linux +#ifdef LINUX #define fds_bits __fds_bits #endif /* Linux */ diff --git a/utils/cd_obj b/utils/cd_obj new file mode 100644 index 0000000..72bc485 --- /dev/null +++ b/utils/cd_obj @@ -0,0 +1 @@ +cd ../../obj/$SICS_VERSION/psi/utils diff --git a/utils/make_gen b/utils/make_gen new file mode 100644 index 0000000..ec322d9 --- /dev/null +++ b/utils/make_gen @@ -0,0 +1,50 @@ +#--------------------------------------------------------------------------- +# Makefile for the Utilities in the utils directory, +# +# e.g. SerPortServer asynsrv_test +# +# David Maden, Sep-2000 +# M.Z. Oct-2003 (system independent version) +#-------------------------------------------------------------------------- + +.SUFFIXES: +.SUFFIXES: .c .o + +VPATH=$(SRC) +ROOT=../.. +HLIB=../hardsup/libhlib.a +LIBS = -L/usr/X11R6/lib -lX11 +#---------------------------------------------------------- + +all: asynsrv_test SerPortServer $(ALPHA) + +#---------------------------------------------------------- + +SerPortServer: SerPortServer.c $(HLIB) + $(CC) $(CFLAGS) -o $@ $Q $(LIBS) + +asynsrv_test: asynsrv_test.c $(HLIB) + $(CC) $(CFLAGS) -o $@ $Q $(LIBS) + +el734: el734.c $(HLIB) +# @ echo "el734 needs Motif library. Not yet found on linux" + $(CC) $(CFLAGS) -o $@ $Q $(LIBS) -lXt -lXm + +el734_test: el734_test.c $(HLIB) + $(CC) $(CFLAGS) -o $@ $Q $(LIBS) + +el737: el737.c $(HLIB) +# @ echo "el737 needs Motif library. Not yet found on linux" + $(CC) $(CFLAGS) -o $@ $Q $(LIBS) -lXm -lXt -lm + +#---------------------------------------------------------- + +clean: + - rm -f *.o + - rm -f SerPortServer \ + asynsrv_test \ + el734 \ + el734_test \ + el737 + +#---------------------------------------------------------- diff --git a/utils/makefile b/utils/makefile new file mode 100644 index 0000000..afe8fd1 --- /dev/null +++ b/utils/makefile @@ -0,0 +1,8 @@ +# this makefile delegates to a version specific makefile + +# where this subdirectory is (relative to the sics root) +S_DOWN=psi/utils +# where root is (from here) +S_UP=../.. + +include ../../make_forward diff --git a/utils/makefile_alpha b/utils/makefile_alpha new file mode 100644 index 0000000..3866e56 --- /dev/null +++ b/utils/makefile_alpha @@ -0,0 +1,26 @@ +#--------------------------------------------------------------------------- +# Makefile for the SINQ hardware utilities +# machine-dependent part for Tru64 Unix +# +# Mark Koennecke, November 1996 +# Markus Zolliker, Oct 2003 +#-------------------------------------------------------------------------- + +include ../../alpha_def + +CC = cc +CFLAGS = -std1 -g $(DFORTIFY) -I$(SRC). -I$(ROOT)/psi/hardsup/$(SRC) +ALPHA = el737 el734 el734_test + +# -- the following macros are used as a replacement for some automatic variables +# due to different make versions. +# This is for Tru64 standard make. +# +# list of prerequisites including paths for VPATH +Q=$> + +# Fortran/C source file name +F=$*.f +C=$*.c + +include make_gen diff --git a/utils/makefile_linux b/utils/makefile_linux new file mode 100644 index 0000000..096df50 --- /dev/null +++ b/utils/makefile_linux @@ -0,0 +1,25 @@ +#--------------------------------------------------------------------------- +# Makefile for the SINQ hardware utilities +# machine-dependent part for Redhat Linux with AFS at PSI +# +# Mark Koennecke, November 1996 +# Markus Zolliker, Oct 2003 +#-------------------------------------------------------------------------- + +include ../../$(SRC)linux_def + +CC = gcc +CFLAGS = -g -DLINUX $(DFORTIFY) -I$(SRC). -I$(ROOT)/psi/hardsup/$(SRC) + +# -- the following macros are used as a replacement for some automatic variables +# due to different make versions. +# This is for GNU make. +# +# list of prerequisites including paths for VPATH +Q=$^ + +# Fortran/C source file name +F=$< +C=$< + +include $(SRC)make_gen