#
#
#

prefix=..
exec_prefix=../../compiler
g_includes=-I/usr/local/include
g_libraries=-L/usr/local/lib

CCX=gcc
COB=${exec_prefix}/htcobol
ASM=as
RM=rm -f

COPYBOOKS= -I../copybooks -I.
INCLUDES= -I/usr/local/include
LIBS=${g_libraries} -L../../lib -lhtcobol -lm
LDFLAGS=
COBFLAGS=-P -D ${COPYBOOKS}
ASMFLAGS=-D
CCXFLAGS=-g ${INCLUDES}

SRC1 = test15.cob 
SRC2 = test15a.cob
SRC3 = test15b.c
SRC4 = test15d.c 
SRC5 = test15a.cob
SRC6 = test15e.cob
SRC7 = test15f.c

OBJS1 = $(SRC1:.cob=.o) $(SRC2:.cob=.o) $(SRC3:.c=.o)
OBJS2 = $(SRC4:.c=.o) $(SRC5:.cob=.o)
OBJS3 = $(SRC6:.cob=.o) $(SRC7:.c=.o)

PROG1 = test15
PROG2 = test15d
PROG3 = test15e
PROGS = $(PROG1) $(PROG2) $(PROG3)


include ${prefix}/config/C.rules.in
include ${prefix}/config/COB.rules.in

all: ${PROGS}

${PROG1}: ${OBJS1}
	$(CCX) -g -o $@ ${OBJS1} $(LDFLAGS) $(LIBS)
#	strip $@

${PROG2}: ${OBJS2}
	$(CCX) -g -o $@ ${OBJS2} $(LDFLAGS) $(LIBS)
#	strip $@

${PROG3}: ${OBJS3}
	$(CCX) -g -o $@ ${OBJS3} $(LDFLAGS) $(LIBS)
#	strip $@

clean:
	@${RM} ${OBJS1} $(PROG1) $(PROG1)*lis ${PROG1}*txt ${PROG1}*s \
	${OBJS2} $(PROG2) $(PROG2)*lis ${PROG2}*txt ${PROG2}*s \
	${OBJS3} $(PROG3) $(PROG3)*lis ${PROG3}*txt ${PROG3}*s \
	*.lis *.s *.trace.txt core 

