#----------------------------------------------------------------------------
# Makefile for SICS
#
# Mark Koennecke 1996-2000
#   Markus Zolliker March 2000: add tecs
#---------------------------------------------------------------------------
BINTARGET=$(HOME)/bin/sics


#------- comment and uncommanet this if a fortified version is required.
# A -DFORTIFY needs to be added to the CFLAGS as well.
#FORTIFYOBJ = fortify.o strdup.o
FORTIFYOBJ = 

#----- comment and uncomment according if a difrac version is required
#DIFOBJ=
#DIFIL=
#DIFOBJ=difrac.o  -Ldifrac -ldif -lfor
#---- 
DIFOBJ=difrac.o  -Ldifrac -ldif 
DIFIL= difrac.o

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 \
       sicsexit.o  costa.o task.o $(FORTIFYOBJ)\
       macro.o ofac.o obpar.o obdes.o drive.o status.o intserv.o \
       devexec.o mumo.o mumoconf.o selector.o selvar.o fupa.o lld.o \
       lld_blob.o buffer.o strrepl.o ruli.o lin2ang.o fomerge.o\
       script.o o2t.o  alias.o napi.o nxdata.o stringdict.o sdynar.o\
       histmem.o histdriv.o histsim.o sinqhmdriv.o interface.o callback.o \
        event.o emon.o evcontroller.o evdriver.o simev.o perfmon.o \
       danu.o itc4driv.o itc4.o nxdict.o nxsans.o varlog.o stptok.o nread.o \
       dilludriv.o scan.o fitcenter.o telnet.o token.o scontroller.o serial.o \
       tclev.o hkl.o integrate.o optimise.o dynstring.o nextrics.o nxutil.o \
       mesure.o uubuffer.o serialwait.o commandlog.o sps.o udpquieck.o \
       sanswave.o faverage.o bruker.o rmtrail.o fowrite.o ltc11.o \
       simchop.o choco.o chadapter.o docho.o trim.o eurodriv.o scaldate.o \
       hklscan.o xytable.o amor2t.o nxamor.o amorscan.o amorstat.o \
       circular.o el755driv.o maximize.o sicscron.o tecsdriv.o
 
MOTOROBJ = motor.o el734driv.o simdriv.o el734dc.o pipiezo.o pimotor.o
COUNTEROBJ =  countdriv.o simcter.o counter.o
DMCOBJ     =  dmc.o
VELOOBJ    = velo.o velosim.o velodorn.o velodornier.o

.SUFFIXES:
.SUFFIXES: .tcl .htm .c .o

#------------- for Digital Unix
HDFROOT=/data/koenneck
CC=cc
EXTRA=
CFLAGS = -I$(HDFROOT)/include -Ihardsup  -std1 -g -warnprotos -c
#CFLAGS = -I$(HDFROOT)/include -DFORTIFY -Ihardsup  -g -std1 -warnprotos -c
LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Ltecs -ltecsl -ltcl8.0 -lfor -lmfhdf -ldf \
  $(HDFROOT)/lib/libjpeg.a -lz  -lm -ll -lc 

#------- for cygnus
#HDFROOT=../HDF411 
#CC=gcc
#EXTRA=
#CFLAGS = -I$(HDFROOT)/include -Ihardsup -DFORTIFY -DCYGNUS  -g -c
#LIBS= -L$(HDFROOT)/lib  -Lhardsup -lhlib -ltcl80 \
#    -lmfhdf -ldf -ljpeg -lz -lm  

#---------- for linux
#HDFROOT=/usr/local
#TCLROOT=/home/koenneck/tcl76
#CC=gcc
#CFLAGS = -I$(HDFROOT)/include -Ihardsup -fwritable-strings  -DCYGNUS  -g -c
#LIBS= -L$(HDFROOT)/lib  -Lhardsup -L$(TCLROOT)/lib -lhlib \
#      -ltcl7.6 -lmfhdf -ldf -ljpeg -lz -lm  -lg2c -ldl
#EXTRA=nintf.o


.c.o:
	$(CC) $(CFLAGS) $*.c

all: server 

server: $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) $(DMCOBJ) $(VELOOBJ) $(DIFIL) \
            $(EXTRA)
	$(CC) -g  -o SICServer $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) $(DMCOBJ) \
        $(VELOOBJ) $(DIFOBJ) $(EXTRA) $(LIBS)
	cp SICServer $(BINTARGET)

clean:
	- rm *.o
	- rm SICServer

Dbg.o:  Dbg.c
	cc -g  -I/data/koenneck/include -c Dbg.c
Dbg_cmd.o:  Dbg_cmd.c


