PROGNAME=
CFG=
OUTDIR=
INTDIR=
SDK=
LINKTYPE=

# Set to 1 to allow the building using the DLL version of SNMPLIB.
ALLOW_DLL=1

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE 
NULL=nul
!ENDIF 

ALL : "..\bin\$(OUTDIR)\snmpd.exe" "$(INTDIR)"


"..\bin\$(OUTDIR)" :
    if not exist "..\bin\$(OUTDIR)/$(NULL)" mkdir "..\bin\$(OUTDIR)"

"$(INTDIR)" :
    if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"

CPP=cl.exe
!IF  "$(CFG)" == "release"
CPP_PROJ=/nologo /MD /W3 /EHsc /Zi /O2 /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c 
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winservice.res" /d "NDEBUG" 
!ELSE
CPP_PROJ=/nologo /MDd /W3 /Gm /EHsc /Zi /Od /I "." /I ".." /I "..\..\snmplib" /I "..\.." /I "..\..\include" /I "..\..\agent" /I "..\..\agent\mibgroup" /D "WIN32" /D "_BIND_TO_CURRENT_VCLIBS_VERSION" /D "_DEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\$(PROGNAME).pdb" /FD /c 
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winservice.res" /d "_DEBUG" 
!ENDIF

!IF "$(LINKTYPE)" == "dynamic"
CPP_PROJ=$(CPP_PROJ) /D "NMAKE_NETSNMP_USE_DLL"
!ENDIF

.c{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.cpp{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

.cxx{$(INTDIR)}.obj::
   $(CPP) @<<
   $(CPP_PROJ) $< 
<<

RSC=rc.exe
LINK32=link.exe
LINK32_FLAGS=netsnmp.lib netsnmpagent.lib netsnmpmibs.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /out:"..\bin\$(OUTDIR)/snmpd.exe" /libpath:"../lib/$(OUTDIR)"
!IF  "$(CFG)" == "release"
LINK32_FLAGS=$(LINK32_FLAGS) /debug /pdb:"../bin/$(OUTDIR)/snmpd.pdb"
!ELSE
LINK32_FLAGS=$(LINK32_FLAGS) /debug /incremental:no /pdb:"../bin/$(OUTDIR)/snmpd.pdb" /pdbtype:sept
!ENDIF
LINK32_OBJS= \
	"$(INTDIR)\auto_nlist.obj" \
	"$(INTDIR)\kernel.obj" \
	"$(INTDIR)\snmpd.obj" \
	"$(INTDIR)\winservice.obj" \
	"$(INTDIR)\winservice.res"

CLEAN :
	-@for %f in ($(LINK32_OBJS)) do erase %%f
	-@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
	-@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"

"..\bin\$(OUTDIR)\$(PROGNAME).exe" : "..\bin\$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
    $(LINK32) @<<
  $(LINK32_FLAGS) $(LINK32_OBJS)
<<
 if exist "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" \
	    mt.exe -manifest "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest" -outputresource:"..\bin\$(OUTDIR)\$(PROGNAME).exe";1
!ELSE	# Linktype check
	-@echo .
	-@echo Aborting build.  Applications can not be built using --linktype=dynamic
	-@echo .
!ENDIF

!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("snmpd.dep")
!INCLUDE "snmpd.dep"
!ELSE 
!MESSAGE Warning: cannot find "snmpd.dep"
!ENDIF 
!ENDIF 


SOURCE=..\..\agent\auto_nlist.c

"$(INTDIR)\auto_nlist.obj" : $(SOURCE) "$(INTDIR)"
	$(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=..\..\agent\kernel.c

"$(INTDIR)\kernel.obj" : $(SOURCE) "$(INTDIR)"
	$(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=..\..\agent\snmpd.c

"$(INTDIR)\snmpd.obj" : $(SOURCE) "$(INTDIR)"
	$(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=..\..\snmplib\winservice.c

"$(INTDIR)\winservice.obj" : $(SOURCE) "$(INTDIR)"
	$(CPP) $(CPP_PROJ) $(SOURCE)


SOURCE=..\..\snmplib\winservice.rc

"$(INTDIR)\winservice.res" : $(SOURCE) "$(INTDIR)"
	$(RSC) $(RSC_PROJ) /i "..\..\snmplib" $(SOURCE)
