diff --git a/site_ansto/Makefile b/site_ansto/Makefile old mode 100644 new mode 100755 index 6da99396..51d68603 --- a/site_ansto/Makefile +++ b/site_ansto/Makefile @@ -7,6 +7,8 @@ # Markus Zolliker, March 2003 #========================================================================== +.PHONY: sct + default: all # ANSTO rules and variables @@ -16,7 +18,7 @@ PSI_LIBS = \ -ldl -lz -lm -lc $(LIB_MXML) $(LIB_JSON) CC = gcc INCFLAGS = -Ihardsup -I.. $(INC_HDF5) $(INC_TCL8) -# NOTE -std=gnu99 adds c99 support with gnu extensions, it eliminates implicit function warnings +# 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. @@ -25,7 +27,9 @@ INCFLAGS = -Ihardsup -I.. $(INC_HDF5) $(INC_TCL8) # may be in different locations. This code tries to find the include files and # libraries required in descending order of preference. -libsearch = $(wildcard /usr/lib*/lib$(1).so /usr/lib*/lib$(1).so.? /usr/lib*/lib$(1).so.??* /usr/lib*/lib$(1).a) +libsearcha = $(wildcard /usr/lib*/lib$(1).a) +libsearchso = $(wildcard /usr/lib*/lib$(1).so /usr/lib*/lib$(1).so.? /usr/lib*/lib$(1).so.??*) +libsearch = $(firstword $(call libsearcha,$(1)) $(call libsearchso,$(1))) libsearch1 = $(firstword $(call libsearch,$(1))) incsearch = $(wildcard /usr/include/$(1) /usr/local/include/$(1)) incsearch1 = $(firstword $(call incsearch,$(1))) @@ -41,7 +45,7 @@ $(foreach myinc,$(myincs),$(info incsearch1($(myinc)) = $(call incsearch1,$(myin endif # TCL 8.5 or 8.4 -LIB_TCL8 = $(firstword $(call libsearch1,tcl8.5) $(call libsearch1,tcl8.4)) +LIB_TCL8 = $(firstword $(call libsearchso,tcl8.5) $(call libsearchso,tcl8.4)) INC_TCL8 = $(firstword $(call incsearch1,tcl.h) $(call incsearch1,tcl8.5/tcl.h) $(call incsearch1,tcl8.4/tcl.h)) ifeq (,$(LIB_TCL8)) @@ -123,7 +127,7 @@ SITEHARDSUP = hardsup/libhlib.a HARDSUPDIR = $(SITEDIR)/hardsup SUBLIBS = libansto.a hardsup/libhlib.a $(PSI_SLIBS) libansto.a hardsup/libhlib.a $(PSI_LIBS) -.SUFFIXES: +.SUFFIXES: .SUFFIXES: .c .o .f GHTTP_LIBS = $(LIB_HTTP) @@ -154,7 +158,9 @@ OBJ= site_ansto.o anstoutil.o\ beamstopaction.o action.o \ tclClock.o tclDate.o tclUnixTime.o -all: config libsics libansto.a libhardsup +all: | config libsics libhardsup SICServer + +SICServer: ../SICSmain.o libansto.a hardsup/libhlib.a ../libsics.a ../matrix/libmatrix.a | config libsics libhardsup $(CC) -g -o SICServer ../SICSmain.o $(SUBLIBS) $(GHTTP_LIBS) config: