# Makefile for minithreads on x86/NT

# You probably do not need to modify this, unless you are adding extra files.

CC = cl.exe
LINK = link.exe

WINSOCKLIB = ws2_32.lib

VISUALSTUDIO = c:\Program Files\Microsoft Visual Studio
SYSLIBPATH = "$(VISUALSTUDIO)\VC98\lib\\"
CFLAGS = /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"minithreads.pch" /YX /Fo"" /Fd"" /FD /GZ /c 
LFLAGS = /nologo /subsystem:console /incremental:no /pdb:"minithreads.pdb" /debug /machine:I386 /out:"minithreads.exe" /pdbtype:sept /LIBPATH:$(SYSLIBPATH)


LIB = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib $(WINSOCKLIB)

# change this to the name of the file you want to link with minithreads, 
# dropping the ".c": so to use "sieve.c", change to "MAIN = sieve".

MAIN = sieve

OBJ = 	random.obj\
	interrupts.obj \
	minithread.obj \
	machineprimitives_x86.obj \
	machineprimitives.obj \
	queue.obj \
	$(MAIN).obj \
	synch.obj 



all: minithreads.exe

wince: 
	nmake /f Makefile_WinCE MAIN=$(MAIN)

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

minithreads.exe: start.obj end.obj $(OBJ)
	$(LINK) $(LFLAGS) $(LIB) start.obj $(OBJ) end.obj $(LFLAGS)

clean:
	-@del /F /Q *.obj
	-@del /F /Q minithreads.pch minithreads.pdb 
	-@del /F /Q minithreads.exe

#depend: 
#	gcc -MM *.c 2>/dev/null | sed -e "s/\.o/.obj/" > depend


include Depend
