

CC_FLAGS= $(CFLAGS)
LD_LIBS= $(LDLIBS)

#
# Default Makefile Rules
#

install :: all

clean ::
	rm -f Makefile.full

#
# Makefile Rules
#




EXTRA_LIBS= ../timelib/libtime.a
CC_OPT= -g

CC_FLAGS=$(CFLAGS) -I../lang-common 

LITE_OBJS= parser.o lite_lex.o lite.o symtab.o types.o code-gen.o code-sim.o extern.o modules.o http.o fcrypt.o $(MODS) mod_lite.o



# Make rules for building lite.o

lite.o : lite.c Makefile.full 
	$(CC) $(CC_FLAGS) -c lite.c

clean ::
	rm -f lite.o lite.lint


# Make rules for building lite_lex.o

lite_lex.o : lite_lex.c Makefile.full 
	$(CC) $(CC_FLAGS) -c lite_lex.c

clean ::
	rm -f lite_lex.o lite_lex.lint


# Make rules for building mod_lite.o

mod_lite.o : mod_lite.c Makefile.full 
	$(CC) $(CC_FLAGS) -c mod_lite.c

clean ::
	rm -f mod_lite.o mod_lite.lint


# Make rules for building modules.o

modules.o : modules.c Makefile.full 
	$(CC) $(CC_FLAGS) -c modules.c

clean ::
	rm -f modules.o modules.lint




# Make rules for building lite

all : lite

lite : mod_lite.o ../lang-common/mod_std.o ../lang-common/mod_msql.o lite.o lite_lex.o modules.o ../lang-common/liblite.a ../msql/libmsql.a ../timelib/libtime.a ../regexp/libregexp.a Makefile.full
	$(LINK) $(CC_FLAGS) mod_lite.o ../lang-common/mod_std.o ../lang-common/mod_msql.o lite.o lite_lex.o modules.o ../lang-common/liblite.a ../msql/libmsql.a ../timelib/libtime.a ../regexp/libregexp.a -o lite $(LD_LIBS) 

clean :: 
	rm -f lite


#
# 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: lite_lex.c
	$(CC) -traditional $(CC_FLAGS) -DLEX_DEBUG -DNOTDEF -g -o lextest lite_lex.c


install ::
	if test -f $(INST_DIR)/bin/lite;\
	then\
		rm -f $(INST_DIR)/bin/lite.old;\
		mv $(INST_DIR)/bin/lite $(INST_DIR)/bin/lite.old;\
	fi;\
	cp lite $(INST_DIR)/bin/lite
	chmod 0755 $(INST_DIR)/bin/lite

install ::
	if test -f $(INST_DIR)/lib/lite_lex.o;\
	then\
		rm -f $(INST_DIR)/lib/lite_lex.o.old;\
		mv $(INST_DIR)/lib/lite_lex.o $(INST_DIR)/lib/lite_lex.o.old;\
	fi;\
	cp lite_lex.o $(INST_DIR)/lib/lite_lex.o
	chmod 0755 $(INST_DIR)/lib/lite_lex.o

install ::
	if test -f $(INST_DIR)/lib/mod_lite.o;\
	then\
		rm -f $(INST_DIR)/lib/mod_lite.o.old;\
		mv $(INST_DIR)/lib/mod_lite.o $(INST_DIR)/lib/mod_lite.o.old;\
	fi;\
	cp mod_lite.o $(INST_DIR)/lib/mod_lite.o
	chmod 0755 $(INST_DIR)/lib/mod_lite.o


mod_lite.o: ../lang-common/lite.h 
mod_lite.o: ../common/portability.h
mod_lite.o: ../common/config.h 
mod_lite.o: ../regexp/regexp.h

lite.o: ../lang-common/lite.h 
lite.o: ../common/portability.h
lite.o: ../common/config.h 
lite.o: ../regexp/regexp.h

lite_lex.o: ../lang-common/lite.h 
lite_lex.o: ../common/portability.h
lite_lex.o: ../common/config.h 
lite_lex.o: ../regexp/regexp.h

modules.o: ../lang-common/lite.h 
modules.o: ../common/portability.h
modules.o: ../common/config.h 
modules.o: ../regexp/regexp.h
modules.o: ../lang-common/mod_std.h
modules.o: ../lang-common/mod_msql.h


