-
David Gaskell authoredDavid Gaskell authored
Makefile.Unix 3.52 KiB
#
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
ctp_sources = thTest.c thTestParse.c thTestExecute.c thHandlers.c thParm.c \
thUtils.c thLoad.c thGroup.c thReport.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)