# 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
LIBS = xkernel.lib xio.lib xutil.lib
CCEXE = $(CC) $(COUTFLAG)$*.exe $(CFLAGS) -I$(H) -L$(L) $(LIBS)

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

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

.obj.exe:
	$(CCEXE) $*.obj

SRCS = l3x.c
OBJS = l3x.obj simple.obj
EXES = l3x.exe simple.exe

l3x: cleanl3 l3x.exe

l3x.exe: l3x.obj {$(L)}$(LIBS)
	$(CCEXE) xshell.lib $*.obj

simple.exe: simple.obj {$(L)}$(LIBS)
	$(CCEXE) $*.obj

all: $(EXES)

ex7: cleanex7 ex7.exe

ex7.exe: ex7cont.obj ex7.obj
	$(CCEXE) $?

ex10.exe: kgetc1.obj ex10.obj
	$(CCEXE) $?

clean:
	del *.exe
	del *.obj

cleanl3:
	del l3x.exe
	del l3x.obj

cleanex7:
	del ex7*.obj
	del ex7.exe

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

