154 lines
4.1 KiB
Makefile
154 lines
4.1 KiB
Makefile
# vim: ft=make ts=4 sw=4 noet cindent
|
|
#---------------------------------------------------------------------------
|
|
# Makefile for SICS
|
|
# machine-dependent part for Redhat Linux with AFS at PSI
|
|
#
|
|
# Mark Koennecke 1996-2001
|
|
# Markus Zolliker, March 2003
|
|
#==========================================================================
|
|
|
|
include ../linux_def
|
|
# TODO Should use PSI ../make_gen instead of make_gen_variables
|
|
include make_gen_variables
|
|
default: all
|
|
|
|
# PSI rules and variables
|
|
EXTRA=nintf.o
|
|
PSI_CLEAN_MATRIX = rm -f ../*.o ../psi/*.o; $(MAKE) -C ../matrix $(MFLAGS) clean
|
|
PSI_CFLAGS = -I./ -I$(HDFROOT)/include -DDO_NOT_SELECT_BEFORE_SEND -DHDF5 -DNXXML\
|
|
-DCYGNUS -DNONINTF -std=gnu99 -g $(DFORTIFY)\
|
|
-Wall -Wextra -Wno-unused
|
|
PSI_SLIBS = matrix/libmatrix.a
|
|
PSI_LIBS = -L$(HDFROOT)/lib $(NILIB)\
|
|
-ltcl8.4 $(HDFROOT)/lib/libhdf5.a \
|
|
-ldl -lz -lm -lc /usr/lib/libmxml.a /usr/local/lib/libjson.a
|
|
|
|
../%.o : ../%.c
|
|
cd ..; $(CC) -c $(PSI_CFLAGS) $*.c -o $*.o
|
|
|
|
# Some files a generated from templates by tjxp
|
|
../%.c: ../%.tc
|
|
cd ..; tcl/tjxp $*.tc $*.c
|
|
|
|
../matrix/libmatrix.a:
|
|
make -C ../matrix $(MFLAGS) libmatrix.a
|
|
|
|
# ANSTO rules and variables
|
|
CC = gcc
|
|
INCFLAGS = -Ihardsup -I.. -I/opt/gnome/include
|
|
# NOTE -std=gnu99 adds c99 support with gnu extensions, it eliminates implicit function warnings
|
|
# for c99 functions like roundf. We don't use -std=c99 because it generates compiler errors in
|
|
# code modules that use the timeval struct without including sys/time.h, c99 also generates
|
|
# implicit function declaration warnings on string functions like strdup.
|
|
DEBUGFLAGS = -Wall -Wextra -Wno-unused -Wno-comment -Wno-switch
|
|
CFLAGS = -g $(INCFLAGS) $(DEBUGFLAGS) -std=gnu99
|
|
HDFROOT=/usr/local
|
|
|
|
SRC = ./../..
|
|
SITENAME = _ansto
|
|
SITEDIR = site_ansto
|
|
SITELIB = libansto.a
|
|
SITEHARDSUP = hardsup/libhlib.a
|
|
HARDSUPDIR = $(SITEDIR)/hardsup
|
|
SUBLIBS = libansto.a hardsup/libhlib.a
|
|
VPATH = $(SRC)
|
|
TANGOROOT = /usr/local/lib/
|
|
OMNIORBROOT = /usr/local/lib
|
|
COREDIR = $(SRC)
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .o .f
|
|
|
|
TANGOLIBS = \
|
|
/usr/local/lib/libclient.a \
|
|
/usr/local/lib/liblog4tango.a \
|
|
/usr/local/lib/libtango.a \
|
|
/usr/local/lib/libomniDynamic4.a \
|
|
/usr/local/lib/libomniORB4.a \
|
|
/usr/local/lib/libomnithread.a
|
|
|
|
GHTTP_LIBS = \
|
|
/opt/gnome/lib/libghttp.a
|
|
|
|
#OBJ= site_ansto.o batch.o buffer.o ruli.o protocol.o sinfox.o \
|
|
# motor_asim.o motor_dmc2280.o motor_pdx.o \
|
|
# itc4.o itc4driv.o \
|
|
# hm_mrpd.o scan_mrpd.o
|
|
|
|
|
|
OBJ= site_ansto.o anstoutil.o\
|
|
ansto_sctdriveadapter.o\
|
|
sctemonadapter.o\
|
|
motor_asim.o motor_dmc2280.o\
|
|
lh45.o lh45driv.o \
|
|
lakeshore340.o lakeshore340driv.o \
|
|
west4100.o west4100driv.o \
|
|
nhq200.o \
|
|
orhvps.o \
|
|
ls340.o \
|
|
fsm.o \
|
|
counterdriv.o \
|
|
safetyplc.o \
|
|
../psi/tcpdornier.o \
|
|
anstohttp.o \
|
|
hmcontrol_ansto.o\
|
|
lssmonitor.o \
|
|
beamstopaction.o action.o
|
|
|
|
all: ../matrix/libmatrix.a $(COREOBJ:%=../%) $(EXTRA:%=../%) libansto.a libhardsup
|
|
$(CC) -g -o SICServer $(COREOBJ:%=../%) $(EXTRA:%=../%) $(SUBLIBS) $(PSI_SLIBS:%=../%) $(PSI_LIBS) $(GHTTP_LIBS)
|
|
|
|
#TODO Add targets for other instruments
|
|
echidna: all
|
|
make -C instrument/hrpd
|
|
koala: all
|
|
make -C instrument/qld
|
|
kowari: all
|
|
make -C instrument/rsd
|
|
platypus: all
|
|
make -C instrument/reflectometer
|
|
quokka: all
|
|
make -C instrument/sans
|
|
taipan: all
|
|
make -C instrument/tas
|
|
wombat: all
|
|
make -C instrument/hipd
|
|
|
|
libansto.a: $(OBJ)
|
|
rm -f libansto.a
|
|
ar cr libansto.a $(OBJ)
|
|
ranlib libansto.a
|
|
|
|
libhardsup:
|
|
$(MAKE) -C hardsup/
|
|
|
|
anstohm.o : anstohm.cpp
|
|
$(CXX) -c anstohm.cpp $(CFLAGS) $(CXXFLAGS) -Wno-all
|
|
|
|
hm_mrpd.o : hm_mrpd.cpp
|
|
$(CXX) -c hm_mrpd.cpp $(CFLAGS) $(CXXFLAGS) -Wno-all
|
|
|
|
hm_asim.o : hm_asim.cpp
|
|
$(CXX) -c hm_asim.cpp $(CFLAGS) $(CXXFLAGS) -Wno-all
|
|
|
|
anstoclean:
|
|
$(MAKE) -C hardsup clean
|
|
rm -f SICServer
|
|
rm -f *.a
|
|
rm -f *.o
|
|
|
|
clean: anstoclean
|
|
$(PSI_CLEAN_MATRIX)
|
|
|
|
MZOBJ=fsm.o logger.o sugar.o pardef.o ease.o strobj.o oxinst.o \
|
|
ipsdriv.o ilmdriv.o itcdriv.o ighdriv.o euro2kdriv.o modbus.o
|
|
|
|
incflags:
|
|
@echo ${INCFLAGS}
|
|
|
|
cflags:
|
|
@echo ${CFLAGS}
|
|
|
|
deploy: all
|
|
cd instrument; ./make_sics_tar.tcl
|