SOURCE_DIR=$(BASE_SOURCE_DIR)/lang-common

CC_FLAGS=$(CFLAGS) $(SYS_ERR) -DINST_DIR='"$(INST_DIR)"' $(HAVE_DYNAMIC)
CC_OPT= -g

YACC_FLAGS= -d


MODS=mod_std.o mod_msql.o
EXTRA_LIBS= 


all: parser.o symtab.o types.o code-gen.o code-sim.o extern.o fcrypt.o mod_std.o mod_msql.o lib.o


!yacc parser.y

!object mod_std.o mod_std.c
!object mod_msql.o mod_msql.c

!library_unix liblite.a symtab.c,types.c,code-gen.c,code-sim.c,extern.c,fcrypt.c,lib.c parser.o
!dll_os2 lite symtab.c,types.c,code-sim.c,extern.c,fcrypt.c,lib.c,code-gen.c,parser.c ../regexp/libregexp.a

!libinstall liblite.a $(INST_DIR)/lib/liblite.a 744 $(ROOT)
!install mod_std.o $(INST_DIR)/lib/mod_std.o 744 $(ROOT)
!install mod_msql.o $(INST_DIR)/lib/mod_msql.o 744 $(ROOT)
!install mod_std.h $(INST_DIR)/include/mod_std.h 744 $(ROOT)
!install mod_msql.h $(INST_DIR)/include/mod_msql.h 744 $(ROOT)
!install lite.h $(INST_DIR)/include/lite.h 744 $(ROOT)


#
# Debugging compilations
#
# Note : if you want to build lextest and you are using the GNU cpp (for
# example, you are using gcc to compile this code) you'll have to put
# -traditional in the compilation line below.  If you don't, you'll get
# some ANSI cpp garbage that doesn't let you expand a macro param within
# quotes.  In this case you'll get a line of 'x' characters down the left
# side of the screen when you run lextest.
#

lextest: lexer.c
	$(CC) $(CFLAGS) -DLEX_DEBUG -DNOTDEF -g -o lextest lexer.c

lite_lextest: lite_lex.c
	$(CC) $(CFLAGS) -DLEX_DEBUG -DNOTDEF -g -o lite_lextest lite_lex.c


mod_std.o: lite.h ../common/portability.h ../common/config.h 
mod_std.o: ../msql/msql.h ../regexp/regexp.h

mode_msql.o: lite.h ../common/portability.h ../common/config.h 
mode_msql.o: ../msql/msql.h ../regexp/regexp.h

types.o: memory.h code-gen.h mod_msql.h mod_std.h types.h
types.o:  lite.h y.tab.h
types.o: lite.h ../common/portability.h ../common/config.h 

code-gen.o: memory.h code-gen.h mod_msql.h mod_std.h types.h
code-gen.o: lite.h y.tab.h
code-gen.o: lite.h ../common/portability.h ../common/config.h 

code-sim.o: memory.h code-gen.h mod_msql.h mod_std.h types.h
code-sim.o: lite.h y.tab.h
code-sim.o: lite.h ../common/portability.h ../common/config.h 

extern.o: memory.h code-gen.h mod_msql.h mod_std.h types.h
extern.o: lite.h y.tab.h
extern.o: lite.h ../common/portability.h ../common/config.h 

fcrypt.o: memory.h code-gen.h mod_msql.h mod_std.h types.h
fcrypt.o: lite.h y.tab.h
fcrypt.o: lite.h ../common/portability.h ../common/config.h 
