#
# Makefile for tkradiastools + Microsoft Visual C++ 2003 ToolKit
# 
# (c) 2007 Bastian Spiegel <bs@tkscript.de> 
#

TARGET="tkradiastools.dll"

#VCTK=f:/fli/tools/dev/MSVCTK2003
#W32API=f:/fli/tools/dev/MSVCTK2003/w32api


PREFIX=/usr

#
#
#

MAKE      = make
CC        = "$(VCTK)/bin/cl.exe"
LD        = "$(VCTK)/bin/link.exe"

# ---- maximum speed, target >PentiumPro ----
OPTFLAGS  = /Ox 
#OPTFLAGS  = 

# ---- minimum size, target >Pentium ----
#OPTFLAGS  = /O1 /G5

EXTRAFLAGS = /D_CRT_SECURE_NO_DEPRECATE
EXTRALIBS= 

#
#
#
CPPFLAGS= /I../yac /I"$(VCTK)/include" /I"$(W32API)/include" /I"../../../yac" /nologo /DWIN32 $(EXTRAFLAGS) 

LDFLAGS= /INCREMENTAL:NO /MACHINE:X86 /VERSION:0.9 /DLL


RM        = rm -f
ZIP	  = zip

include make.objects



#
# Build shared executable
#
shared:		$(ALL_OBJ) 
		$(LD) $(LDFLAGS) /OUT:$(TARGET) $(ALL_OBJ) /LIBPATH:"$(VCTK)/lib" $(EXTRALIBS)
		@echo "Build finished at `date +%H:%M`."

install: shared
	cp $(TARGET) ../
	@echo "[...] $(TARGET) installed to ../";

#
# Show help
#
help:
		@echo "       help      : this page."
		@echo "       shared    : build dynamically linked $(TARGET)."
		@echo "       install   : build $(TARGET) and install to \"$(PREFIX)\"."
		@echo "       clean     : remove object files."
		@echo "       realclean : clean and remove backup files."




#
# Rule for building object files
#
.cpp.o:
		$(CC) $(CPPFLAGS) $(OPTFLAGS) /c $< /Fo"$@"


#
# Remove object files and targets.
#
clean:
		@echo "cleaning up.."
		$(RM) $(ALL_OBJ) 

#
# Make clean and remove backup files
#
realclean:	clean
		$(RM) `find . -name \*\~` $(TARGET) *.exp *.lib *.plg




