1 ###############################################################################
4 # @brief Builds up test programs.
6 # @author Yury GEORGIEVSKIY, CERN.
8 # @date Created on 13/01/2009
9 ###############################################################################
11 # Makefile from current directory supress one from upper level
12 include $(shell if [ -e ./Makefile.specific ]; then \
13 echo ./Makefile.specific; \
15 echo ../Makefile.specific; \
18 include ../$(ROOTDIR)/makefiles/Makefile.base
19 include ../$(ROOTDIR)/makefiles/rules.mk
21 vpath %.c ./ ../../utils/user ../../utils/extest
23 ADDCFLAGS = $(STDFLAGS) -DDRIVER_NAME=\"$(DRIVER_NAME)\"
25 # libraries (and their pathes) to link executable file with
26 XTRALIBDIRS = ../$(ROOTDIR)/utils/user/object ../$(ROOTDIR)/lib/stub/object ../$(FINAL_DEST)
27 LOADLIBES := $(addprefix -L,$(XTRALIBDIRS)) $(LOADLIBES) -lutils.$(CPU) -lstub.$(CPU)
29 # Get all local libs (in object_ directory) user wants to compile with
30 LOCAL_LIBS = $(patsubst ../$(FINAL_DEST)/lib%.a, -l%, $(wildcard ../$(FINAL_DEST)/*.$(CPU).a))
31 XTRALIBS = -lxml2 -lz -lreadline
36 SRCFILES = $(wildcard *.c)
38 # the standard test program (utils/extest) will be compiled
39 # unless USE_EXTEST is set to 'n'
40 ifneq ($(USE_EXTEST), n)
44 # if the driver is skel, we'll compile in all the skel handlers
46 SRCFILES += cmd_skel.c
47 ADDCFLAGS += -D__SKEL_EXTEST__
49 # if not, then the generic ones are taken to handle built-in commands
50 SRCFILES += cmd_generic.c
53 endif # end USE_EXTEST
56 SRCFILES += extra_for_lynx.c
57 # for dlopen, dlclose etc.
58 LOADLIBES += /acc/sys/$(CPU)/lib/shlib/libdl.so
60 LOADLIBES += -lrt -ltermcap
73 /acc/local/$(CPU)/include
75 EXEC_OBJS = $(DRIVER_NAME)Test-stub.$(CPU)
77 $(EXEC_OBJS): $(OBJFILES)
79 _build: $(EXEC_OBJS) $(OBJDIR) $(FINAL_DEST) move_objs
81 # Move compiled files to proper place
83 $(Q)mv $(OBJFILES) $(OBJDIR)
84 $(Q)mv $(EXEC_OBJS) ../$(FINAL_DEST)
87 include ../$(ROOTDIR)/makefiles/deliver.mk
89 cleanloc clearloc:: abort
90 @ if [ -n "$(OBJDIR)" ]; then \
93 -rm -f ../$(FINAL_DEST)/testprog $(DRIVER_NAME)libTst
94 -find ./ -name '*~' -o -name '*.$(CPU).o' | xargs rm -f