TARGETTMP := ${OBJSDIR}${TARGETNAME}
TARGET := ${WORKINGDIR}${TARGETNAME}
+CONFIGDIRNAME := configs/
+CONFIGDIR := ../${CONFIGDIRNAME}
+CONFIGDEST := ${WORKINGDIR}${CONFIGDIRNAME}
+
+CONFIGS := # := start
+CONFIGS += keys.cfg
+CONFIGS := $(addprefix ${CONFIGDEST},${CONFIGS})
+
DEPSBLDDIRS := $(addprefix ${DEPSDIR},${DIRS})
OBJSBLDDIRS := $(addprefix ${OBJSDIR},${DIRS})
-BLDDIRS := ${OBJSBLDDIRS} ${DEPSBLDDIRS} ${WORKINGDIR}
+BLDDIRS := ${OBJSBLDDIRS} ${DEPSBLDDIRS} ${WORKINGDIR} ${CONFIGDEST}
VERBOSE := 0
endif
.PHONY: all
-all: ${TARGET}
+all: ${TARGET} ${CONFIGS}
+
+# rule to copy the config files into the working directory
+${CONFIGDEST}%.cfg: ${CONFIGDIR}%.cfg | ${CONFIGDIR} ${WORKINGDIR}
+ ${Q1}echo "cp: $@"
+ ${Q2}cp -r $< $@
# rule to copy tmp target to working directory
${TARGET}: ${TARGETTMP} | ${WORKINGDIR}
${Q1}echo "cp: $@"
- ${Q2}cp $^ $@
+ ${Q2}cp $< $@
# how to link the main target
${TARGETTMP}: ${OBJS}