Skip to content

Commit

Permalink
Fix auto-generation of Makefiles to have the correct dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Jan 14, 2014
1 parent 9dbdad7 commit 1523c5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/tests/auth/all.mk
Expand Up @@ -38,8 +38,11 @@ $(BUILD_DIR)/tests/auth/depends.mk: $(addprefix $(DIR)/,$(AUTH_FILES)) | $(BUILD
@rm -f $@
@for x in $^; do \
y=`grep 'PRE: ' $$x | sed 's/.*://;s/ / /g;s, , $(BUILD_DIR)/tests/auth/,g'`; \
echo "$$x: $$y" >> $@; \
echo "" >> $@; \
if [ "$$y" != "" ]; then \
z=`echo $$x | sed 's,src/,$(BUILD_DIR)/',`; \
echo "$$z: $$y" >> $@; \
echo "" >> $@; \
fi \
done
#
# These ones get copied over from the default input
Expand Down
15 changes: 9 additions & 6 deletions src/tests/keywords/all.mk
Expand Up @@ -7,7 +7,7 @@
# The list is unordered. The order is added in the next step by looking
# at precursors.
#
FILES := $(filter-out %.conf %.md %.attrs %.mk %~,$(subst $(DIR)/,,$(wildcard $(DIR)/*)))
KEYWORD_FILES := $(filter-out %.conf %.md %.attrs %.mk %~,$(subst $(DIR)/,,$(wildcard $(DIR)/*)))

#
# Create the output directory
Expand All @@ -21,7 +21,7 @@ $(BUILD_DIR)/tests/keywords:
# strip out the ones which exist
# move the filenames to the build directory.
#
BOOTSTRAP_EXISTS := $(addprefix $(DIR)/,$(addsuffix .attrs,$(FILES)))
BOOTSTRAP_EXISTS := $(addprefix $(DIR)/,$(addsuffix .attrs,$(KEYWORD_FILES)))
BOOTSTRAP_NEEDS := $(filter-out $(wildcard $(BOOTSTRAP_EXISTS)),$(BOOTSTRAP_EXISTS))
BOOTSTRAP := $(subst $(DIR),$(BUILD_DIR)/tests/keywords,$(BOOTSTRAP_NEEDS))

Expand All @@ -34,12 +34,15 @@ BOOTSTRAP_COPY := $(subst $(DIR),$(BUILD_DIR)/tests/keywords,$(BOOTSTRAP_NEEDS)
#
-include $(BUILD_DIR)/tests/keywords/depends.mk

$(BUILD_DIR)/tests/keywords/depends.mk: $(addprefix $(DIR)/,$(FILES)) | $(BUILD_DIR)/tests/keywords
$(BUILD_DIR)/tests/keywords/depends.mk: $(addprefix $(DIR)/,$(KEYWORD_FILES)) | $(BUILD_DIR)/tests/keywords
@rm -f $@
@for x in $^; do \
y=`grep 'PRE: ' $$x | sed 's/.*://;s/ / /g;s, , $(BUILD_DIR)/tests/keywords/,g'`; \
echo "$$x: $$y" >> $@; \
echo "" >> $@; \
if [ "$$y" != "" ]; then \
z=`echo $$x | sed 's,src/,$(BUILD_DIR)/',`; \
echo "$$z: $$y" >> $@; \
echo "" >> $@; \
fi \
done

#
Expand Down Expand Up @@ -101,7 +104,7 @@ $(BUILD_DIR)/tests/keywords/%: $(DIR)/% $(BUILD_DIR)/tests/keywords/%.attrs $(TE
#
# Get all of the unit test output files
#
TESTS.KEYWORDS_FILES := $(addprefix $(BUILD_DIR)/tests/keywords/,$(FILES))
TESTS.KEYWORDS_FILES := $(addprefix $(BUILD_DIR)/tests/keywords/,$(KEYWORD_FILES))

#
# Depend on the output files, and create the directory first.
Expand Down

0 comments on commit 1523c5d

Please sign in to comment.