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 = subtool dbLoadTemplate

include $(EPICS)/config/RULES.Unix

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

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

dbLoadTemplate: $(OBJS) 
	$(LINK.c) -o $@ $(OBJS) $(LDLIBS) -lDb

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

