test_dir := t
yy_src_dir := yy
yy_build_dir := $(build_dir)/yy
-GIT_VERSION := $(shell $(SHELL_DEFINES) ./version-gen.sh $(PACKAGE) $(version_dir)/version.c)
+GIT_VERSION := $(shell $(MKDIR_P) $(object_dir) $(dep_dir) $(man_dir) \
+ $(m4depdir) $(lls_suite_dir) $(yy_build_dir) && \
+ $(SHELL_DEFINES) ./version-gen.sh $(PACKAGE) $(version_dir)/version.c)
executables := recv filter audioc write afh
ifneq ($(CRYPTOLIB),)
-include $(m4_lls_deps)
endif
-$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \
- $(yy_build_dir):
- @$(MKDIR_P) $@
-
CPPFLAGS += -DLOGLEVELS='$(LOGLEVELS)'
CPPFLAGS += -DSEVERITIES=$(SEVERITIES)
CPPFLAGS += -I$(lls_suite_dir)
$(man_dir)/para_write.1: all_commands := $(write_commands)
$(man_dir)/para_%.1: $(lls_suite_dir)/%.lsg.man \
- $(lls_m4_dir)/copyright.m4 | $(man_dir)
+ $(lls_m4_dir)/copyright.m4
$(call SAY, LLSMAN $<)
cat $< $(all_commands) > $@
$(M4) $(lls_m4_dir)/copyright.m4 >> $@
-$(object_dir)/%.o: %.c | $(object_dir)
+$(object_dir)/%.o: %.c
OD = $(addsuffix .d, $(addprefix $(dep_dir)/, $(1))) \
$(addsuffix .o, $(addprefix $(object_dir)/, $(1)))
$(call OD, compress_filter): CFLAGS += -O3
-$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
+$(object_dir)/%.o: %.c
define CC_CMD
$(call SAY, CC $<)
$(CC) -c -o $(object_dir)/$(*F).o -MMD -MF \
$(dep_dir)/$(*F).d -MT $(object_dir)/$(*F).o \
$(CPPFLAGS) $(STRICT_CFLAGS) $(CFLAGS) $<
endef
-CC_PREREQUISITES := %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
+CC_PREREQUISITES := %.c | $(lsg_h) $(yy_h)
# There should be a # better way to write these.
-$(object_dir)/%.o: $(version_dir)/%.c | $(object_dir)
+$(object_dir)/%.o: $(version_dir)/%.c
$(CC_CMD)
$(object_dir)/%.o: $(CC_PREREQUISITES)
$(CC_CMD)
.PRECIOUS: $(lls_suite_dir)/%.suite $(lsg_h)
lls_m4_include_dir := $(lls_m4_dir)/include
-$(lls_suite_dir)/%.m4d: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
+$(lls_suite_dir)/%.m4d: $(lls_m4_dir)/%.suite.m4
$(call SAY, M4D $<)
$(M4) -Pg -I $(lls_m4_include_dir) -s $< \
| awk '{if ($$1 ~ /#line/) {gsub(/"/, "", $$3); if ($$3 != "$<") \
print "$(lls_suite_dir)/$(*F).suite: " $$3}}' | sort | uniq > $@
-$(lls_suite_dir)/%.suite: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
+$(lls_suite_dir)/%.suite: $(lls_m4_dir)/%.suite.m4
$(call SAY, M4 $<)
$(M4) -Pg -I $(lls_m4_include_dir) -D GIT_VERSION=$(GIT_VERSION) \
-D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) -D LOGLEVELS=$(LOGLEVELS) \
$(call SAY, LSGM $<)
$(LOPSUBGEN) --gen-man --output-dir $(lls_suite_dir) < $<
-$(object_dir)/%.o: $(lls_suite_dir)/%.c | $(object_dir)
+$(object_dir)/%.o: $(lls_suite_dir)/%.c
$(call SAY, CC $<)
$(CC) -c -o $@ $(CPPFLAGS) $(STRICT_CFLAGS) $<
.PRECIOUS: $(yy_build_dir)/%.flex.c $(yy_build_dir)/%.bison.c \
$(yy_build_dir)/%.bison.h
-$(yy_build_dir)/%.flex.c: $(yy_src_dir)/%.lex | $(yy_build_dir)
+$(yy_build_dir)/%.flex.c: $(yy_src_dir)/%.lex
@[ -z "$(Q)" ] || echo 'FLEX $<'
@$(FLEX) -o $@ $<
@$(BISON) --defines=$(yy_build_dir)/$(notdir $(<:.y=.bison.h)) \
--output=$(yy_build_dir)/$(notdir $(<:.y=.bison.c)) $<
-$(object_dir)/%.o: $(yy_build_dir)/%.c | $(object_dir)
+$(object_dir)/%.o: $(yy_build_dir)/%.c
@[ -z "$(Q)" ] || echo 'CC $<'
@$(Q) $(CC) -g -c -o $@ $(CPPFLAGS) -MMD -MF $(dep_dir)/$(*F).d \
-MT $@ -iquote . -Wno-unused-macros $<