Skip to content
Snippets Groups Projects
Commit 360d1181 authored by benjamin.franksen's avatar benjamin.franksen
Browse files

snc: several Makefile fixes

- fixed a long-standing problem with parallel builds
- work-arounds for various EPICS base versions
parent f62258b7
No related branches found
No related tags found
No related merge requests found
......@@ -13,11 +13,8 @@ PROD_HOST += snc
snc_LIBS += $(EPICS_BASE_IOC_LIBS)
#snc_SRCS += snl.re # lexer spec
#snc_SRCS += snl.lem # parser spec
snc_SRCS += lexer.c # generated by re2c
snc_SRCS += snl.c # generated by lemon
snc_OBJS += lexer.o # generated by re2c from snl.re
snc_OBJS += snl.o # generated by lemon from snl.lem
snc_SRCS += main.c # main program
snc_SRCS += expr.c # generate expressions
......@@ -42,29 +39,47 @@ include $(TOP)/configure/RULES
vpath %.lem ..
vpath %.lt ..
snl.c: snl.lem snl.lt $(LEMON)
$(RM) snl.c snl.h
$(LEMON) o=. $<
# this extra dependency needed for 3.14.8 compatibility
lexer.o: snl.h
# empty recipy needed to work around make bug #35455
snl.h: snl.c ;
snl.c snl.h snl.out: parser_created
parser_created: snl.lem snl.lt $(LEMON)
$(LEMON) o=. $<
@echo > parser_created
vpath %.re ..
# this ifdef needed for 3.14.8 compatibility
ifdef T_A
lexer.c: snl.re
$(RE2C) -s -b -o $@ $<
# work around bug in base rules
lexer$(OBJ): snl.h
endif
$(COMMON_DIR)/snl.bnf: snl.lem
$(RM) $@
$(LEMON) o=. -g $< > $@.tmp
$(MV) $@.tmp $@
$(LEMON) o=. -g $< > $@
$(COMMON_DIR)/bnf.inc: ../bnf2txt.pl snl.re $(COMMON_DIR)/snl.bnf
$(RM) $@
$(PERL) $^ > $@
$(INSTALL_DOC)/%: $(COMMON_DIR)/%
@$(INSTALL) -d -m 644 $< $(INSTALL_DOC)
$(INSTALL) -d -m 644 $< $(INSTALL_DOC)
ifdef BASE_3_14
%$(DEP): %.c
@-$(MKMF) $(HDEPENDS_FLAGS) -m $*$(DEP) $(HDEPENDS_INCLUDES) $*$(OBJ) $<
endif
ifdef BASE_3_15
CLEANS += lexer.c lexer$(DEP) parser_created snl.c snl$(DEP) snl.h
else
ifdef T_A
clean::
@$(RM) lexer.c lexer$(DEP) parser_created snl.c snl$(DEP) snl.h
endif
endif
# this ifdef needed for 3.14.8 compatibility
ifdef T_A
-include lexer$(DEP) snl$(DEP)
endif
......@@ -86,6 +86,7 @@ DBD += vxTestHarness.dbd
vxTestHarness_DBD += base.dbd
vxTestHarness_DBD += $(COMMON_DIR)/vxTestHarnessRegistrars.dbd
# needed for base 3.14.10 compatibility:
USR_DBDFLAGS += -I $(COMMON_DIR)
DB += vxTestHarness.db
......
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