2000-05-23 01:55:31 +00:00
|
|
|
#
|
|
|
|
# Makefile for Microsoft C compilers. Tested against Visual C++ 6.0.
|
|
|
|
# Not pretty but it seems to work.
|
|
|
|
#
|
|
|
|
# Run with "nmake /f Makefile.msc". Expects NufxLib to have been built
|
|
|
|
# in "..\nufxlib-$(VERSION)".
|
|
|
|
#
|
|
|
|
# To build without debugging info, use "nmake nodebug=1".
|
2002-12-06 00:53:10 +00:00
|
|
|
# To build with libz, use "nmake libz=1".
|
2002-10-10 23:45:56 +00:00
|
|
|
# To build with libbz2, use "nmake libbz2=1".
|
2003-02-09 04:25:57 +00:00
|
|
|
# If you're linking against nufxlib as a DLL, you don't need to specify
|
|
|
|
# libraries. You probably need to specify DLL=1 and the same setting
|
|
|
|
# of the NODEBUG flag as you used when building the DLL. If you don't,
|
|
|
|
# "test-extract" will fail in the fwrite() call in Nu_FWrite, because
|
|
|
|
# the non-debug /MD libc does something peculiar with FILE*.
|
2002-10-10 23:45:56 +00:00
|
|
|
#
|
|
|
|
# For libz/libbz2, you need to have the appropriate library either
|
|
|
|
# in this directory or in a standard location that the linker can find.
|
2000-05-23 01:55:31 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Windows magic
|
|
|
|
TARGETOS = BOTH
|
|
|
|
!include <ntwin32.mak>
|
|
|
|
|
2007-02-19 23:11:55 +00:00
|
|
|
VERSION=220
|
2000-05-23 01:55:31 +00:00
|
|
|
NUFXSRCDIR = ..\nufxlib-$(VERSION)
|
|
|
|
|
|
|
|
# object files
|
2002-10-10 23:45:56 +00:00
|
|
|
OBJS1 = Add.obj ArcUtils.obj Binary2.obj Delete.obj Extract.obj Filename.obj
|
|
|
|
OBJS2 = List.obj Main.obj MiscStuff.obj MiscUtils.obj State.obj SysUtils.obj
|
2000-05-23 01:55:31 +00:00
|
|
|
OBJS = $(OBJS1) $(OBJS2)
|
|
|
|
|
2002-12-06 00:53:10 +00:00
|
|
|
!ifdef DLL
|
2003-02-09 04:25:57 +00:00
|
|
|
### build using the same libc as the DLL
|
2002-12-06 00:53:10 +00:00
|
|
|
!ifdef NODEBUG
|
2003-03-06 01:06:07 +00:00
|
|
|
#OPT = $(cdebug) /D NDEBUG /MD
|
2002-12-06 00:53:10 +00:00
|
|
|
OPT = $(cdebug) /MD
|
|
|
|
LIB_FLAGS = /nodefaultlib:libcd.lib /nologo setargv.obj
|
|
|
|
!else
|
2003-03-06 01:06:07 +00:00
|
|
|
#OPT = $(cdebug) /MDd
|
|
|
|
OPT = $(cdebug) /D DEBUG_MSGS /MDd
|
2002-12-06 00:53:10 +00:00
|
|
|
LIB_FLAGS = /nodefaultlib:libc.lib /nologo setargv.obj
|
|
|
|
!endif
|
|
|
|
!else
|
2003-02-09 04:25:57 +00:00
|
|
|
|
2002-12-06 00:53:10 +00:00
|
|
|
### build against static lib
|
2000-05-23 01:55:31 +00:00
|
|
|
!ifdef NODEBUG
|
2003-03-06 01:06:07 +00:00
|
|
|
#OPT = $(cdebug) /D NDEBUG /ML
|
2000-05-23 01:55:31 +00:00
|
|
|
OPT = $(cdebug) /ML
|
|
|
|
LIB_FLAGS = /nodefaultlib:libcd.lib /nologo libc.lib setargv.obj
|
|
|
|
!else
|
2003-03-06 01:06:07 +00:00
|
|
|
#OPT = $(cdebug) /MLd
|
|
|
|
OPT = $(cdebug) /D DEBUG_MSGS /MLd
|
2000-05-23 01:55:31 +00:00
|
|
|
LIB_FLAGS = /nodefaultlib:libc.lib /nologo libcd.lib setargv.obj
|
|
|
|
!endif
|
2002-12-06 00:53:10 +00:00
|
|
|
!endif
|
2000-05-23 01:55:31 +00:00
|
|
|
|
|
|
|
BUILD_FLAGS = /W3 /GX /D "WIN32" /D "_CONSOLE" /I "$(NUFXSRCDIR)"
|
|
|
|
|
2002-10-10 23:45:56 +00:00
|
|
|
!ifdef LIBZ
|
|
|
|
LIB_FLAGS = zlib.lib $(LIB_FLAGS)
|
|
|
|
!endif
|
|
|
|
!ifdef LIBBZ2
|
|
|
|
LIB_FLAGS = libbz2.lib $(LIB_FLAGS)
|
|
|
|
!endif
|
|
|
|
|
2000-05-23 01:55:31 +00:00
|
|
|
# how to compile sources
|
|
|
|
.c.obj:
|
2002-12-06 00:53:10 +00:00
|
|
|
@$(cc) $(OPT) $(BUILD_FLAGS) $(cflags) $(cvars) -o $@ $<
|
2000-05-23 01:55:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
PRODUCT = nulib2.exe
|
|
|
|
|
|
|
|
all: $(PRODUCT)
|
|
|
|
|
2003-02-27 21:36:35 +00:00
|
|
|
nulib2.exe: $(OBJS) $(NUFXSRCDIR)\nufxlib2.lib
|
|
|
|
$(link) $(ldebug) $** -out:$@ $(NUFXSRCDIR)\nufxlib2.lib $(LIB_FLAGS)
|
2000-05-23 01:55:31 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
del *.obj
|
|
|
|
del $(PRODUCT)
|
|
|
|
|
|
|
|
Add.obj: Add.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
ArcUtils.obj: ArcUtils.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
2002-10-10 23:45:56 +00:00
|
|
|
Binary2.obj: Binary2.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
2000-05-23 01:55:31 +00:00
|
|
|
Delete.obj: Delete.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
Extract.obj: Extract.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
Filename.obj: Filename.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
List.obj: List.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
Main.obj: Main.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
MiscStuff.obj: MiscStuff.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
MiscUtils.obj: MiscUtils.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
State.obj: State.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
SysUtils.obj: SysUtils.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
|
|
|
|
|