# = LIBRARY DEFINITIONS ======================================================

INCPATH  = ./include
LIBPATH  = ./lib

# = CORE DEFINITIONS =========================================================

CFLAGS   = -s -Os -c -I$(INCPATH) -Wall
NFLAGS	 = -f win32

# = MAKEFILE =================================================================

all : sfcure01.sys

sfcure01.sys : sfcure01.o drvproc.o
	gcc sfcure01.o drvproc.o -Wl,--base-file,base.tmp -Wl,--entry,_DriverEntry@8 -nostartfiles -nostdlib -lntoskrnl -o null
	dlltool --dllname sfcure01.sys --base-file base.tmp --output-exp temp.exp
	gcc sfcure01.o drvproc.o -Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,temp.exp -mdll -nostartfiles -nostdlib -lntoskrnl -s -o sfcure01.sys

sfcure01.o : sfcure01.c
	gcc $(CFLAGS) $<

drvproc.o : drvproc.asm
	nasm $(NFLAGS) $< -o drvproc.o
