!if $(msc) > 0

compile=cl /c /AL /Ox $(flgs)
link=cl /AL /Ox $(flgs)
linkpend=/link /SE:512 /ST:4000 /NOE /F /E /PACK
exec=/Fe

!else

compile=tcc -c $(flgs) -ml
link=tcc $(flgs) -ml
exec=-e

!endif


!if $(delivery) > 0

$(dvnm).exe : activate.obj lnrate.obj compile.obj net.obj layer.obj \
              dribble.obj weights.obj convert.obj $(dvnm).obj buildnet.obj \
              teach.obj prop.obj pairs.obj show.obj netio.obj parser.obj \
              sysdep.obj
	$(link) $(exec)$(dvnm) *.obj $(linkpend)

$(dvnm).obj : $(dvnm).c buildnet.c net.c prop.c pairs.c dribble.c convert.c \
	      sysdep.c common.h weights.h layer.h net.h netio.h
	$(compile) $(dvnm).c

!else

nets.exe : activate.obj lnrate.obj compile.obj net.obj layer.obj dribble.obj \
	  weights.obj convert.obj netmain.obj buildnet.obj teach.obj \
	  prop.obj pairs.obj show.obj netio.obj parser.obj sysdep.obj
	$(link) $(exec)nets *.obj $(linkpend)

netmain.obj : netmain.c buildnet.c compile.c convert.c dribble.c layer.c \
	      netio.c net.c pairs.c show.c sysdep.c teach.c common.h layer.h \
	      weights.h net.h netio.h
	$(compile) netmain.c
	
!endif


activate.obj : activate.c common.h
	$(compile) activate.c

buildnet.obj : buildnet.c convert.c layer.c lnrate.c netio.c parser.c \
	       weights.c common.h layer.h weights.h net.h netio.h
	$(compile) buildnet.c

compile.obj : compile.c buildnet.c net.c netio.c sysdep.c common.h layer.h \
	      weights.h net.h netio.h 
	$(compile) compile.c

convert.obj : convert.c common.h
	$(compile) convert.c

dribble.obj : dribble.c convert.c net.c netio.c common.h layer.h weights.h \
	      net.h netio.h
	$(compile) dribble.c

layer.obj : layer.c convert.c lnrate.c weights.c common.h layer.h weights.h \
	    net.h netio.c 
	$(compile) layer.c

lnrate.obj : lnrate.c convert.c common.h 
	$(compile) lnrate.c

net.obj : net.c convert.c netio.c pairs.c parser.c prop.c common.h layer.h \
	  weights.h net.h netio.h
	$(compile) net.c

netio.obj : netio.c common.h netio.h
	$(compile) netio.c

pairs.obj : pairs.c convert.c netio.c parser.c sysdep.c common.h layer.h \
	    weights.h net.h netio.h
	$(compile) pairs.c

parser.obj : parser.c convert.c netio.c pairs.c common.h netio.h
	$(compile) parser.c

prop.obj : prop.c activate.c common.h layer.h weights.h net.h
	$(compile) prop.c

show.obj : show.c layer.c net.c netio.c weights.c common.h layer.h weights.h \
	   net.h
	$(compile) show.c

sysdep.obj : sysdep.c common.h
	$(compile) sysdep.c

teach.obj : teach.c convert.c dribble.c layer.c netio.c pairs.c prop.c \
	    sysdep.c common.h layer.h weights.h net.h
	$(compile) teach.c

weights.obj : weights.c convert.c netio.c common.h layer.h weights.h netio.h
	$(compile) weights.c
