# # glst by Davide Libenzi ( SMTP GreyListing module ) # Copyright (C) 2004 Davide Libenzi # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Davide Libenzi # # !IF "$(CFG)" == "" CFG=debug !ENDIF !IF "$(CFG)" != "release" && "$(CFG)" != "debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE nmake /f makefile CFG=debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "release" ( Win32 x86 release build ) !MESSAGE "debug" ( Win32 x86 debug build) !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF GLST=glst.exe DBDUMP=dbdump.exe DBLOAD=dbload.exe SRC_DIR=. INCL_DIRS=/I. /I".\wgdbm" CMN_OPTS=/D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE !IF "$(CFG)" == "release" OUTDIR=.\release CPP_FLAGS=/nologo $(CMN_OPTS) $(INCL_DIRS) /Zp1 /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" \ /Fo"$(OUTDIR)\\" /FD /c LINK_DEBUG= !ELSEIF "$(CFG)" == "debug" OUTDIR=.\debug CPP_FLAGS=/nologo $(CMN_OPTS) $(INCL_DIRS) /Zp1 /Zi /W3 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" \ /Fo"$(OUTDIR)\\" /FD /c LINK_DEBUG=/DEBUG !ENDIF CPP=cl.exe LINK32=link.exe LINK32_FLAGS=".\wgdbm\gdbm.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 ws2_32.lib /subsystem:console /incremental:no /machine:I386 $(LINK_DEBUG) \ /nodefaultlib:libc.lib GLST_OBJS= \ "$(OUTDIR)\glst.obj" DBDUMP_OBJS= \ "$(OUTDIR)\dbdump.obj" DBLOAD_OBJS= \ "$(OUTDIR)\dbload.obj" ALL_TARGETS="$(OUTDIR)\$(GLST)" "$(OUTDIR)\$(DBDUMP)" "$(OUTDIR)\$(DBLOAD)" ALL_OBJECTS=$(GLST_OBJS) $(DBDUMP_OBJS) $(DBLOAD_OBJS) ALL : $(ALL_TARGETS) CLEAN : -@erase $(ALL_TARGETS) -@erase $(ALL_OBJECTS) -@erase *.pdb *.idb *.pch "$(OUTDIR)\*.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)\$(NULL)" mkdir "$(OUTDIR)" "$(OUTDIR)\$(GLST)" : "$(OUTDIR)" $(GLST_OBJS) $(LINK32) @<< $(LINK32_FLAGS) /out:"$(OUTDIR)\$(GLST)" $(GLST_OBJS) << "$(OUTDIR)\$(DBDUMP)" : "$(OUTDIR)" $(DBDUMP_OBJS) $(LINK32) @<< $(LINK32_FLAGS) /out:"$(OUTDIR)\$(DBDUMP)" $(DBDUMP_OBJS) << "$(OUTDIR)\$(DBLOAD)" : "$(OUTDIR)" $(DBLOAD_OBJS) $(LINK32) @<< $(LINK32_FLAGS) /out:"$(OUTDIR)\$(DBLOAD)" $(DBLOAD_OBJS) << SOURCE="$(SRC_DIR)\glst.c" "$(OUTDIR)\glst.obj" : $(SOURCE) "$(OUTDIR)" $(CPP) $(CPP_FLAGS) $(SOURCE) SOURCE="$(SRC_DIR)\dbdump.c" "$(OUTDIR)\dbdump.obj" : $(SOURCE) "$(OUTDIR)" $(CPP) $(CPP_FLAGS) $(SOURCE) SOURCE="$(SRC_DIR)\dbload.c" "$(OUTDIR)\dbload.obj" : $(SOURCE) "$(OUTDIR)" $(CPP) $(CPP_FLAGS) $(SOURCE)