Experimental Physics and
| |||||||||||||||
|
I have an RF phase and amplitude detection application which needs to be built slightly differently for each RF station. I want to keep the code as one single app and build multiple products. I need each product to have its own CFLAGS definition to pick up its correct code. Here is the Makefile I have so far, including the two options I have tried, but which do not work. TOP=../.. include $(TOP)/configure/CONFIG-uC5282 include $(EPICS_BASE)/configure/CONFIG_GDB #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE #============================= DO_STRIP_OBJ=NO #============================= # build an ioc application #PROD_HOST = padMonitor PROD_IOC_RTEMS += pad-gen PROD_IOC_RTEMS += pad-ref PROD_IOC_RTEMS += pad-lsr PROD_IOC_RTEMS += pad-l1xkly PROD_IOC_RTEMS += pad-genkly PROD_IOC_RTEMS += pad-bph # pad.dbd will be created and installed DBD += pad.dbd pad_DBD += base.dbd pad_DBD += devPad.dbd pad_DBD += drvPad.dbd USR_CFLAGS_RTEMS += -D__rtems # CHOOSE 1! depending on which instance of the code you want to run: # Use PAD_GEN for RFGun1, RFGun2, L0A, L0B, TCav, L1S, L2Tcav # Use PAD_REF for RF distribution # Use PAD_LSR for laser # Use PAD_L1X_KLY for L1X and L1X Kly (yes, really) # Use PAD_KLY for RFGun Kly, L0A Kly, L0B Kly, TCav Kly, L1S Kly L2TCav Kly # Use PAD_BPH for Beam Phase Cavity 1 and 2 Combo # 5/30/7: option 1. this doesn't work. None of these flags get used because # <product>_CFLAGS_* is not interpreted pad-gen_CFLAGS_RTEMS += -DPAD_GEN pad-ref_CFLAGS_RTEMS += -DPAD_REF pad-lsr_CFLAGS_RTEMS += -DPAD_LSR pad-l1xkly_CFLAGS_RTEMS += -DPAD_L1XKLY pad-kly_CFLAGS_RTEMS += -DPAD_KLY pad-bph_CFLAGS_RTEMS += -DPAD_BPH # 5/30/7: option 2. this doesn't work because PROD_IOC_RTEMS is a list of all the # targets so every test matches! #ifeq ($(findstring gen,$(PROD_IOC_RTEMS)),gen) #USR_CFLAGS += -DPAD_GEN #endif #ifeq ($(findstring ref,$(PROD_IOC_RTEMS)),ref) #USR_CFLAGS += -DPAD_REF #endif #ifeq ($(findstring lsr,$(PROD_IOC_RTEMS)),lsr) #USR_CFLAGS += -DPAD_LSR #endif #ifeq ($(findstring l1xkly,$(PROD_IOC_RTEMS)),l1xkly) #USR_CFLAGS += -DPAD_L1X_KLY #endif #ifeq ($(findstring genkly,$(PROD_IOC_RTEMS)),genkly) #USR_CFLAGS += -DPAD_KLY #endif #ifeq ($(findstring bph,$(PROD_IOC_RTEMS)),bph) #USR_CFLAGS += -DPAD_BPH #endif # <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd pad-gen_SRCS += pad_registerRecordDeviceDriver.cpp # Repeat as pad-gen_SRCS for pad-ref_SRCS, pad-lsr_SRCS, ... # Add locally compiled object code pad-gen_SRCS += drvPad.c pad-gen_SRCS += devAiPad.c pad-gen_SRCS += devAiCnstPad.c pad-gen_SRCS += devWaveformPad.c pad-gen_SRCS += devLonginPad.c pad-gen_SRCS += devLongoutPad.c pad-gen_SRCS += devBoPad.c pad-gen_SRCS += devMbboPad.c # Repeat as pad-gen_SRCS for pad-ref_SRCS, pad-lsr_SRCS, ... # SNCSEQ stuff here (.st and libs) # OTHER LIBS here # HOST PRODUCTS here #=========================== include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE debug: @echo targets are $(PROD_IOC_RTEMS) thank-you, Dayle Kotturi [email protected] LINAC Coherent Light Source office 650-926-4923 Stanford Linear Accelerator Center fax 650-926-4778
| ||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |