# l3x makefile

# make builds l3x.exe / simple.exe
# l3x.exe depends on l3x.obj and l3x libraries 
#          but is also implicitly linked from:
#            -  OBJ of C startup routine 
#            -  C libraries

# l3x.obj depends on l3x.c and the header files it includes

# libraries do not depend (an earlier make on sources is assumed)


# include standard MAKE variables from lib\Config.mk
!include $(L3X)\lib\Config.mk

# but redefine header files and get warnings from compiler
CFLAGS = -I$(L3X)\src\h

.c.obj:
	$(CC) -c $(CFLAGS) $<

.asm.obj:
	$(ASM) $*;

.obj.exe:
        $(CC) $(COUTFLAG)$*.exe $(CFLAGS) -L$(L)  $*.obj  $(LIBS)

SRCS = l3x.c
OBJS = l3x.obj simple.obj
EXES = l3x.exe simple.exe
LIBS = xkernel.lib xio.lib xutil.lib xshell.lib

all:	$(EXES)

l3x.exe: l3x.obj {$(L)}$(LIBS)
	$(CC) $(COUTFLAG)l3x.exe $(CFLAGS) -L$(L)  $*.obj  $(LIBS)

simple.exe: simple.obj {$(L)}$(LIBS)
	$(CC) $(COUTFLAG)simple.exe $(CFLAGS) -L$(L)  $*.obj  $(LIBS)

clean:  
	del *.exe
	del *.obj

testhlt.obj: $(H)\conf.h $(H)\io.h $(H)\kernel.h testhlt.c

simple.obj: $(H)\conf.h $(H)\kernel.h $(H)\shell.h simple.c
l3x.obj: $(H)\conf.h $(H)\kernel.h $(H)\shell.h l3x.c
