EPICS = ../../../..
include Target.include
include $(EPICS)/config/CONFIG_BASE

LEX = $(ELEX)
YACC = $(EYACC)
YACCOPT = -l
LEXOPT = -L

SRCS.c = ../dbVarSub.c dbLoadTemplate_lex.c dbLoadTemplate.c \
		dbLoadRecords_lex.c dbLoadRecords.c
OBJS = dbVarSub.o dbLoadTemplate.o dbLoadRecords.o

PROD = dbSubs

include $(EPICS)/config/RULES.Vx

#dbLoadTemplate.o: dbLoadTemplate_lex.c dbLoadTemplate.c
#dbLoadRecords.o: dbLoadRecords_lex.c dbLoadRecords.c
dbLoadTemplate.o: dbLoadTemplate_lex.c
dbLoadRecords.o: dbLoadRecords_lex.c
subtool: dbLoadTemplate_lex.c

subtool: dbLoadTemplate.c dbLoadTemplate_lex.c dbVarSub.o
	$(RM) $@
	$(LINK.c) $(CFLAGS) -DSUB_TOOL -o subtool dbLoadTemplate.c dbVarSub.o -s

clean::
	@$(RM) dbLoadTemplate_lex.c dbLoadTemplate.c dbLoadRecords_lex.c \
			dbLoadRecords.c

dbSubs: $(OBJS)
	$(RM) $@
	$(LINK.c) $@ $(OBJS) $(LDLIBS)

