nulib2/nulib2/Makefile.msc

75 lines
2.5 KiB
Makefile

#
# 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".
# To link with libz, use "nmake libz=1".
# To build with libbz2, use "nmake libbz2=1".
#
# For libz/libbz2, you need to have the appropriate library either
# in this directory or in a standard location that the linker can find.
#
# Windows magic
TARGETOS = BOTH
!include <ntwin32.mak>
VERSION=0
NUFXSRCDIR = ..\nufxlib-$(VERSION)
# object files
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
OBJS = $(OBJS1) $(OBJS2)
!ifdef NODEBUG
#OPT = $(cdebug) /D NDEBUG /ML
OPT = $(cdebug) /ML
LIB_FLAGS = /nodefaultlib:libcd.lib /nologo libc.lib setargv.obj
!else
OPT = $(cdebug) /MLd
LIB_FLAGS = /nodefaultlib:libc.lib /nologo libcd.lib setargv.obj
!endif
BUILD_FLAGS = /W3 /GX /D "WIN32" /D "_CONSOLE" /I "$(NUFXSRCDIR)"
!ifdef LIBZ
LIB_FLAGS = zlib.lib $(LIB_FLAGS)
!endif
!ifdef LIBBZ2
LIB_FLAGS = libbz2.lib $(LIB_FLAGS)
!endif
# how to compile sources
.c.obj:
@$(cc) $(cdebug) $(OPT) $(BUILD_FLAGS) $(cflags) $(cvars) -o $@ $<
PRODUCT = nulib2.exe
all: $(PRODUCT)
nulib2.exe: $(OBJS) $(NUFXSRCDIR)\nufxlib.lib
$(link) $(ldebug) $** -out:$@ $(NUFXSRCDIR)\nufxlib.lib $(LIB_FLAGS)
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
Binary2.obj: Binary2.c NuLib2.h $(NUFXSRCDIR)\NufxLib.h SysDefs.h State.h MiscStuff.h
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