Skip to content

Commit

Permalink
Initial revision
Browse files Browse the repository at this point in the history
  • Loading branch information
gaskelld committed Jan 23, 2009
0 parents commit 321b3c2
Show file tree
Hide file tree
Showing 501 changed files with 1,032,342 additions and 0 deletions.
Binary file added CHANGES.TXT
Binary file not shown.
Binary file added CHANGES_TODO.TXT
Binary file not shown.
5 changes: 5 additions & 0 deletions CTP/.cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
O.*
daVarRpc.h
daVarRpc_clnt.c
daVarRpc_svc.c
daVarRpc_xdr.c
31 changes: 31 additions & 0 deletions CTP/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.DELETE_ON_ERROR: ;

include Makefile.variables

MAKEFILENAME = Makefile.Unix


ifeq ($(MYOS),Linux)
SUBDIRNAME = O.Linux
OSEXT =
endif


# OSEXT is either TEST or empty
# If you want to use LinuxTEST as shown above, just pass OSEXT=TEST
# after 'make' on the command line, and leave MYOS as the default (Linux)
# we don't need to do anything with OSEXT here
#export OSEXT #either TEST or empty
#export OSVERSION #not used since we probably can't compile on SunOS anyway

.PHONY: all
all: $(SUBDIRNAME) $(SUBDIRNAME)/Makefile
$(MAKE) -C $(SUBDIRNAME)

$(MAKEFILENAME):
(cd $(SUBDIRNAME) ; ln -f -s ../$(MAKEFILENAME) Makefile)
$(SUBDIRNAME)/Makefile: $(MAKEFILENAME)
(cd $(SUBDIRNAME) ; ln -f -s ../$(MAKEFILENAME) Makefile)

$(SUBDIRNAME):
mkdir $(SUBDIRNAME)
154 changes: 154 additions & 0 deletions CTP/Makefile.Unix
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#


NEWSTYLE = 1

#Only append to CFLAGS and CXXFLAGS the first time through
ifeq ($(MAKELEVEL),2)
ifeq ($(MYOS),Linux)
ifeq ($(F77COMPILER),Absoft)
CFLAGS = -DNOF77extname -DAbsoftUNIXFortran # -DAbsoftUNIXFortran for cfortran.h
else
ifeq ($(OSEXT),TEST)
override CFLAGS += -Df2cFortran -b i486-linux -pg # -Df2cFortran for cfortran.h
else
# CFLAGS = -g -Df2cFortran -b i486-linux -O # -Df2cFortran for cfortran.h
override CFLAGS += -Df2cFortran # -Df2cFortran for cfortran.h
endif
endif
override CXXFLAGS += -fno-exceptions -fPIC
endif

endif
ifeq ($(MYOS),Linux)
# -k generates K&R C
# RPCCOM=rpcgen -b -k
RPCCOM=rpcgen -b
endif

include ../Makefile.etc

ctp_sources = thTest.c thTestParse.c thTestExecute.c thHandlers.c thParm.c \
thUtils.c thLoad.c thGroup.c thHist.c thReport.c thGethit.c \
daVarRegister.c daVarRpcProc.c daVarHandlers.c daVarServ.c \
daVarRpc_svc.c daVarRpc_xdr.c daVarHashLib.c thTree.c
ctpclient_sources = daVarRpc_xdr.c daVarRpc_clnt.c thClient.c

lib_targets := $(patsubst %.c, libctp.a(%.o), $(ctp_sources)) \
$(patsubst %.c, libctpclient.a(%.o), $(ctpclient_sources))


sources = $(ctpclient_sources) $(ctp_sources) makereg.c

bin_targets = makereg

install-dirs := lib bin

ifeq ($(MYOS),IRIX)
CC = gcc
CFLAGS = -DNOFNMATCH
RPCCOM=rpcgen
endif

ifeq ($(MYOS),OSF1)
CC = cc -verbose
CFLAGS = -DNOFNMATCH
RPCCOM=rpcgen
endif

ifeq ($(MYOS),HPUX)
CC = gcc
ifeq ($(OSEXT),TEST)
CFLAGS = -Dhpux -D_HPUX_SOURCE -Dextname -g -pg # for gprof
else
CFLAGS = -Dhpux -D_HPUX_SOURCE -Dextname -g
endif
ARFLAGS = frv
RPCCOM=rpcgen
endif

ifeq ($(MYOS),ULTRIX)
CC = gcc
CFLAGS = -DNOFNMATCH
RPCCOM=/usr/site1/rpc/rpcgen
endif

ifeq ($(MYOS),SunOS)
CC = gcc
ifeq ($(OSVERSION),4)
CFLAGS = -O -DNOFNMATCH
else
CFLAGS = -O
endif
RPCCOM = /usr/bin/rpcgen
endif

ifeq ($(MYOS),AIX)
CC = gcc
CFLAGS = -O -Dextname
RPCCOM = rpcgen
endif


##library: libctp.a


ifdef NFSDIRECTORY

../%.c : $(NFSDIRECTORY)/CTP/%.c
ln -s $< $@

../%.h : $(NFSDIRECTORY)/CTP/%.h
ln -s $< $@

../%.x : $(NFSDIRECTORY)/CTP/%.x
ln -s $< $@

.PRECIOUS: ../%.c ../%.h ../%.x
endif

makereg: makereg.o


RPCDEPENDS_RULE = echo "$(subst .d,.o,$@): \
../$(subst .d,.c,$@) ../daVarRpc.h" >$@

# Include ../daVarRpc.h as a dependency to force it to be made before
# dependencies on non-autogenerated sources are done

daVarRpc_xdr.d: ../daVarRpc.h
echo remaking $@
$(RPCDEPENDS_RULE)

daVarRpc_clnt.d: ../daVarRpc.h
echo remaking $@
$(RPCDEPENDS_RULE)

daVarRpc_svc.d: ../daVarRpc.h
echo remaking $@
$(RPCDEPENDS_RULE)

daVarRpc.d: ../daVarRpc.h
echo remaking $@
touch $@

../daVarRpc_xdr.c: ../daVarRpc.x ../daVar.h daVarRpc_xdr.d
$(RM) $@
(cd .. ; $(RPCCOM) -o $(@F) -c daVarRpc.x)

../daVarRpc_svc.c: ../daVarRpc.x ../daVar.h daVarRpc_svc.d
$(RM) $@
# (cd .. ; $(RPCCOM) -o $(@F) -m daVarRpc.x)
# work around a bug in rpcgen present in Mac OS X 10.4:
(cd .. ; $(RPCCOM) -o temp_svc.c -m daVarRpc.x; sed -e 's/extern/static/g' temp_svc.c > $(@F); $(RM) temp_svc.c)

../daVarRpc_clnt.c: ../daVarRpc.x ../daVar.h daVarRpc_clnt.d
$(RM) $@
(cd .. ; $(RPCCOM) -o $(@F) -l daVarRpc.x)

../daVarRpc.h: ../daVarRpc.x ../daVar.h
$(RM) $@
(cd .. ; $(RPCCOM) -o $(@F) -h daVarRpc.x)

include $(sources:.c=.d)

179 changes: 179 additions & 0 deletions CTP/Makefile.etc
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
#----------------------------------------------------------------------------*
# Copyright (c) 1991, 1992 Southeastern Universities Research Association, *
# Continuous Electron Beam Accelerator Facility *
# *
# This software was developed under a United States Government license *
# described in the NOTICE file included as part of this distribution. *
# *
#CEBAF Data Acquisition Group, 12000 Jefferson Ave., Newport News, VA 23606 *
# heyescebaf.gov Tel: (804) 249-7030 Fax: (804) 249-7363 *
#----------------------------------------------------------------------------*
#Description: follows this header.
#
#Author:
# Graham Heyes
# CEBAF Data Acquisition Group
#
#
#----------------------------------------------------------------------------
# Generic Makefile add more directories here

.DELETE_ON_ERROR: ;
AR = ar
PW := $(shell pwd)
MAKEREG=bin/makereg

include $(sources:.f=.d)
include $(sources:.c=.d)

LIBROOT = lib

# OS dependent declarations of library and include directories etc...

.PRECIOUS: %.d
#.PRECIOUS: %.cmn ../%.cmn %.par ../%.par %.dte ../%.dte %.dec ../%.dec

.PHONY : default depend CLEAN clean ALL_CLEAN all_clean directory csoft ALL_CSOFT all_csoft

ifdef NFSDIRECTORY
DEPENDS_RULE.c = $(CC) -MM $(CFLAGS) $< |\
(sed -e 's|$*.o|& $@|g' -e 's|:|: .os$(MYOS) Makefile |' ;\
cat $< | sed -n -e \ "s|\#include \"|$@: ../|p" |\
sed -e "s|\".*$$||" | sed -e 's|.d:|.o:|') >$@
else
DEPENDS_RULE.c = $(CC) -MM $(CFLAGS) $< |\
sed -e 's|$*.o|& $@|g' -e 's|:|: .os$(MYOS) Makefile |' > $@
endif
DEPENDS_RULE.f = ( cat $< | sed -n -e \
"s|^[ ]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\"]|$@: |p" | \
sed -e "s|['\"].*$$||" | sed -e 's|.d:|.o:|' ; \
echo $*.o: .os$(MYOS) ) > $@
COMPILE_RULE.f = $(FC) $(FFLAGS) -c $< -o $@
COMPILE_RULE.c = $(CC) $(CFLAGS) -c $< -o $@
# Don't "Makefile" to .d files anymore

ifdef NEWSTYLE
%.d: ../%.c
# @echo remaking $@
$(DEPENDS_RULE.c)

%.d: ../%.cpp
# @echo remaking $@
$(DEPENDS_RULE.c)

#r_%.d:
# @echo r_$*.o: r_$*.f > $@

%.d: ../%.f
@echo remaking $@
$(DEPENDS_RULE.f)

%.o: ../%.f
# echo compiling $@
$(COMPILE_RULE.f)

%.o: ../%.c
$(COMPILE_RULE.c)

else
%.d: %.c
# @echo remaking $@
$(DEPENDS_RULE.c)

%.d: %.cpp
# @echo remaking $@
$(DEPENDS_RULE.c)

#%.d: %.f .os$(MYOS)
%.d: %.f
@echo remaking $@
$(DEPENDS_RULE.f)
# ( cat $< | sed -n -e \
# "s/^[ ]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\"]/$<: /p" | \
# sed -e "s/['\"].*$$//" | sed -e 's/.f:/.o:/' ; \
# @echo $*.o: .os$(MYOS) ) > $@

%.o: %.f
$(COMPILE_RULE.f)
endif

#%.f : %.F
# $(FC) -F $<

(%.o): %.o
# @echo Adding $*.o to $@
$(AR) $(ARFLAGS) $@ $*.o
ifdef RANLIB
$(RANLIB) $@
endif

TARGET_PATH := $(OSPREFIX)$(SUBDIR)/
# Phil: the quot variable is used to keep from confusing my syntax highligher
# I put it twice because the syntax highlighter likes to see two quotes
# You could replace $(quot) with a literal " below, but it looks wierd
# and doubly so with VIM's syntax highlighting
quot = "
quot = "
FILES = $(addsuffix $(quot),$(addprefix $(quot)$(TARGET_PATH),$($(SUBDIR)_targets)))

ifdef TARGET_PATH
$(TARGET_PATH)%: %
@echo "Making $@ from $< "
$(RM) -r $@
$(CP) $< $@
$(RM) $<
endif

.os$(MYOS):
$(RM) *.d .os*
@echo $(MYOS) > .os$(MYOS)
@echo remade marker .os$(MYOS)

csoft: $(REGSOURCES)
# @echo "CSOFT - Arch. $(MYOS) sys.vers $(MYOS)$(OSEXT)"
# @echo "`pwd` $(REGSOURCES)"
# if ! ( $(MAKE) ... ) exits the for loop if there's an error. Otherwise the for loop will only return
# an error if the last make command fails. This follows the default behavior of make but breaks the
# -p option. This section could use a rewrite.
@echo "Considering $(shell pwd) ... "
@if test -z "$(install-dirs)"; then \
echo Nothing to do for $(MYOS)$(OSEXT); \
else \
for subdir in $(install-dirs) dummy; do \
if test $$subdir != dummy; then \
echo $(MAKE) SUBDIR=$$subdir OSPREFIX=$(MYOS)$(OSEXT)/ directory;\
if ! ( $(MAKE) SUBDIR=$$subdir OSPREFIX=$(MYOS)$(OSEXT)/ directory ); then exit 1; fi; \
fi \
done \
fi
@echo "Done $(shell pwd)"

depend: .os$(MYOS)
@ echo depending...
@$(MAKE) $(sources:.f=.d)
@$(MAKE) $(sources:.c=.d)

CLEAN clean::
@ echo Cleaning `pwd`
$(RM) -f *.o *.d .os*
@ echo Done.

ALL_CLEAN all_clean:
@ for makefile in `find . -name Makefile -print | sed -e '/Eiffel/d' -e '/pre_/d'`; do \
echo ; \
echo Considering `dirname $$makefile` ... ; \
$(MAKE) -C `dirname $$makefile` clean ; \
done

directory:
@echo Doing directory SUBDIR=$(SUBDIR) OSPREFIX=$(OSPREFIX)
# @echo 'FILES=$(FILES)'
mkdir -p $(TARGET_PATH)
$(MAKE) SUBDIR=$(SUBDIR) OSPREFIX=$(OSPREFIX) $(FILES)

ALL_CSOFT all_csoft:
@ for makefile in `find . -name Makefile -print | sed -e '/Eiffel/d' -e '/pre_/d' -e '/dev_/d`; do \
echo ; \
$(MAKE) -C `dirname $$makefile` csoft ; \
done
@ echo Made csoft for $(MYOS)
Loading

0 comments on commit 321b3c2

Please sign in to comment.