Skip to content
Snippets Groups Projects
Commit 75a092ea authored by Dirk Zimoch's avatar Dirk Zimoch
Browse files

fix driver.makefile bugs: directory order for searching sources and headers...

fix driver.makefile bugs: directory order for searching sources and headers must not be changed and source code files must not be listed twice
parent 2d998491
No related branches found
No related tags found
No related merge requests found
...@@ -108,6 +108,12 @@ IGNOREFILES = .cvsignore .gitignore ...@@ -108,6 +108,12 @@ IGNOREFILES = .cvsignore .gitignore
${IGNOREFILES}: ${IGNOREFILES}:
@echo -e "O.*\n.cvsignore\n.gitignore" > $@ @echo -e "O.*\n.cvsignore\n.gitignore" > $@
define uniq
$(eval seen :=)
$(foreach _,$1,$(if $(filter $_,${seen}),,$(eval seen += $_)))
${seen}
endef
ifndef EPICSVERSION ifndef EPICSVERSION
## RUN 1 ## RUN 1
# in source directory # in source directory
...@@ -324,8 +330,8 @@ ifndef T_A ...@@ -324,8 +330,8 @@ ifndef T_A
AUTOSRCS := $(filter-out ~%,$(wildcard *.c *.cc *.cpp *.st *.stt *.gt)) AUTOSRCS := $(filter-out ~%,$(wildcard *.c *.cc *.cpp *.st *.stt *.gt))
SRCS = $(if ${SOURCES},$(filter-out -none-,${SOURCES}),${AUTOSRCS}) SRCS = $(if ${SOURCES},$(filter-out -none-,${SOURCES}),${AUTOSRCS})
SRCS += ${SOURCES_${EPICS_BASETYPE}} #SRCS += ${SOURCES_${EPICS_BASETYPE}} # added later by VAR_EXTENSIONS
SRCS += ${SOURCES_${EPICSVERSION}} #SRCS += ${SOURCES_${EPICSVERSION}}
export SRCS export SRCS
DBD_SRCS = $(if ${DBDS},$(filter-out -none-,${DBDS}),$(wildcard menu*.dbd *Record.dbd) $(strip $(filter-out %Include.dbd dbCommon.dbd %Record.dbd,$(wildcard *.dbd)) ${BPTS})) DBD_SRCS = $(if ${DBDS},$(filter-out -none-,${DBDS}),$(wildcard menu*.dbd *Record.dbd) $(strip $(filter-out %Include.dbd dbCommon.dbd %Record.dbd,$(wildcard *.dbd)) ${BPTS}))
...@@ -357,8 +363,8 @@ TEMPLS += ${TEMPLATES_${EPICSVERSION}} ...@@ -357,8 +363,8 @@ TEMPLS += ${TEMPLATES_${EPICSVERSION}}
export TEMPLS export TEMPLS
SCR = $(if ${SCRIPTS},$(filter-out -none-,${SCRIPTS}),$(wildcard *.cmd)) SCR = $(if ${SCRIPTS},$(filter-out -none-,${SCRIPTS}),$(wildcard *.cmd))
SCR += ${SCRIPTS_${EPICS_BASETYPE}} #SCR += ${SCRIPTS_${EPICS_BASETYPE}} # added later by VAR_EXTENSIONS
SCR += ${SCRIPTS_${EPICSVERSION}} #SCR += ${SCRIPTS_${EPICSVERSION}}
export SCR export SCR
DOCUDIR = . DOCUDIR = .
...@@ -672,7 +678,7 @@ DBD_PATH = $(sort $(dir ${DBDFILES})) ...@@ -672,7 +678,7 @@ DBD_PATH = $(sort $(dir ${DBDFILES}))
DBDEXPANDPATH = $(addprefix -I , ${DBD_PATH} ${EPICS_BASE}/dbd) DBDEXPANDPATH = $(addprefix -I , ${DBD_PATH} ${EPICS_BASE}/dbd)
USR_DBDFLAGS += $(DBDEXPANDPATH) USR_DBDFLAGS += $(DBDEXPANDPATH)
SRC_INCLUDES = $(addprefix -I, $(sort $(dir ${SRCS:%=../%} ${HDRS:%=../%}))) SRC_INCLUDES = $(addprefix -I, $(strip $(call uniq, $(dir ${SRCS:%=../%} ${HDRS:%=../%}))))
# different macro name for 3.14.8 # different macro name for 3.14.8
GENERIC_SRC_INCLUDES = $(SRC_INCLUDES) GENERIC_SRC_INCLUDES = $(SRC_INCLUDES)
...@@ -767,10 +773,8 @@ RELEASE_INCLUDES += -I${EPICS_BASE}/include/os/${OS_CLASS} ...@@ -767,10 +773,8 @@ RELEASE_INCLUDES += -I${EPICS_BASE}/include/os/${OS_CLASS}
#for 3.13: #for 3.13:
EPICS_INCLUDES += -I$(EPICS_BASE_INCLUDE) -I$(EPICS_BASE_INCLUDE)/os/$(OS_CLASS) EPICS_INCLUDES += -I$(EPICS_BASE_INCLUDE) -I$(EPICS_BASE_INCLUDE)/os/$(OS_CLASS)
# Setup searchpaths from all used files # Find all sources
# find all sources whatever suffix $(foreach file, ${SRCS} ${TEMPLS} ${SCR}, $(eval vpath $(notdir ${file}) ../$(dir ${file})))
$(foreach filetype,SRCS TEMPLS SCR,$(foreach ext,$(sort $(suffix ${${filetype}})),\
$(eval vpath %${ext} $(sort $(dir $(filter %${ext},${${filetype}:%=../%}))))))
# Do not treat %.dbd the same way because it creates a circular dependency # Do not treat %.dbd the same way because it creates a circular dependency
# if a source dbd has the same name as the project dbd. Have to clear %.dbd. # if a source dbd has the same name as the project dbd. Have to clear %.dbd.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment