LCCDIR=.
cc=..\bin\lcc.exe
#generate debug info -g2
cflags=-g2 -A -O
#-------------------------------------------------------------------
#   A list of all of the object files
#-------------------------------------------------------------------
#The startup should be the first object file in a link
ALL_OBJ1 = alloc.obj asm.obj bind.obj cv.obj dag.obj decl.obj enode.obj error.obj
ALL_OBJ2 = event.obj expr.obj gen.obj init.obj input.obj lex.obj win32.obj list.obj
ALL_OBJ3 = main.obj ncpp.obj output.obj prof.obj profio.obj simp.obj seh.obj fastmd.obj
ALL_OBJ4 = stmt.obj string.obj sym.obj trace.obj tree.obj types.obj optim.obj analysis.obj \
intrin.obj libasm.obj
OBJS=$(ALL_OBJ1) $(ALL_OBJ2) $(ALL_OBJ3) $(ALL_OBJ4)
cdebug=
linkdebug=
cvars=
#-------------------------------------------------------------------
all:    lcc.exe
#===================================================================
#
# Dependencies
#
#===================================================================
alloc.obj:	$(LCCDIR)\alloc.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\alloc.c

asm.obj: $(LCCDIR)\asm.c c.h asm.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\asm.c

bind.obj:	$(LCCDIR)\bind.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\bind.c

cv.obj:	$(LCCDIR)\cv.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\cv.c

dag.obj:	$(LCCDIR)\dag.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\dag.c

decl.obj:	$(LCCDIR)\decl.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\decl.c

enode.obj:	$(LCCDIR)\enode.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\enode.c

error.obj:	$(LCCDIR)\error.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\error.c

event.obj:	$(LCCDIR)\event.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\event.c

expr.obj:	$(LCCDIR)\expr.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\expr.c

gen.obj:	$(LCCDIR)\gen.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\gen.c

init.obj:	$(LCCDIR)\init.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\init.c

input.obj:	$(LCCDIR)\input.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\input.c

lex.obj:	$(LCCDIR)\lex.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\lex.c

win32.obj:	win32.c c.h w32incl.c
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\win32.c

win32.c:	win32.md
	lburg win32.md win32.c

list.obj:	$(LCCDIR)\list.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\list.c

main.obj:	$(LCCDIR)\main.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\main.c

ncpp.obj:	$(LCCDIR)\ncpp.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\ncpp.c

null.obj:	$(LCCDIR)\null.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\null.c

output.obj:	$(LCCDIR)\output.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\output.c

prof.obj:	$(LCCDIR)\prof.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\prof.c
profio.obj:       $(LCCDIR)\profio.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\profio.c
seh.obj:	$(LCCDIR)\seh.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\seh.c
optim.obj:	$(LCCDIR)\optim.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\optim.c
simp.obj:       $(LCCDIR)\simp.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\simp.c
string.obj:       $(LCCDIR)\string.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\string.c
stmt.obj:       $(LCCDIR)\stmt.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\stmt.c
sym.obj:       $(LCCDIR)\sym.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\sym.c
trace.obj:       $(LCCDIR)\trace.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\trace.c
tree.obj:       $(LCCDIR)\tree.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\tree.c
types.obj:       $(LCCDIR)\types.c c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\types.c
analysis.obj:	$(LCCDIR)\fastmd.c $(LCCDIR)\c.h
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\analysis.c
fastmd.obj:	$(LCCDIR)\fastmd.c
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\fastmd.c
intrin.obj:	$(LCCDIR)\intrin.c
	$(cc) $(cdebug) $(cflags) $(cvars) $(LCCDIR)\intrin.c
libasm.obj: libasm.asm
	$(cc) libasm.asm
LINKFLAGS=-map lcc.map -s
#Output name lcc.exe (-o lcc.exe)
#Strip symbol table and debug info (-s). Remove this flag to debug.
lcc.exe: $(ALL_OBJ1) $(ALL_OBJ2) $(ALL_OBJ3) $(ALL_OBJ4) makefile
	lcclnk.exe $(LINKFLAGS) -o lcc.exe $(OBJS) $(LIBS)
clean:
	erase $(OBJS) lcc.exe
