nulib2/nufxlib-0/Makefile.msc
Andy McFadden ed801422af Add major version number to library names, so now we have nufxlib2.lib
and nufxlib2.dll.  This allows the possibility of having multiple
(incompatible) versions of the DLL installed in a common location, so
that older and newer apps can coexist peacefully.
2003-02-27 21:35:42 +00:00

104 lines
3.3 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".
#
# To build without debugging info, use "nmake nodebug=1".
# To build with libz, use "nmake libz=1".
# To build with libbz2, use "nmake libbz2=1".
#
# For libz/libbz2, you need to have the appropriate header file(s) either
# in this directory or in a standard location that the compiler can find.
#
!ifdef DLL
ERROR -- use makefile.dll to build the DLL
!endif
# Windows magic
TARGETOS = BOTH
!include <ntwin32.mak>
# object files
OBJS1 = Archive.obj ArchiveIO.obj Bzip2.obj Compress.obj Crc16.obj Debug.obj
OBJS2 = Deferred.obj Deflate.obj Entry.obj Expand.obj FileIO.obj Funnel.obj
OBJS3 = Lzc.obj Lzw.obj MiscStuff.obj MiscUtils.obj Record.obj SourceSink.obj
OBJS4 = Squeeze.obj Thread.obj Value.obj Version.obj
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
!ifdef NODEBUG
#OPT = $(cdebug) /D NDEBUG /ML /O2
OPT = $(cdebug) /ML /O2
!else
OPT = $(cdebug) /MLd /Od
!endif
BUILD_FLAGS = /W3 /GX /D "WIN32"
!ifdef LIBZ
BUILD_FLAGS = $(BUILD_FLAGS) /D "ENABLE_DEFLATE"
!endif
!ifdef LIBBZ2
BUILD_FLAGS = $(BUILD_FLAGS) /D "ENABLE_BZIP2"
!endif
# how to compile sources
.c.obj:
@$(cc) $(OPT) $(BUILD_FLAGS) $(cflags) $(cvars) -o $@ $<
PRODUCT = nufxlib2.lib
all: $(PRODUCT) samples
samples::
@echo -
@echo - Change to the samples directory and run $(MAKE) there.
!ifdef LIBZ
@echo - Remember to specify libz=1
!endif
!ifdef LIBBZ
@echo - Remember to specify libbz2=1
!endif
@echo -
# this isn't great, but it'll have to do
Version.c: Version.c.in
copy Version.c.in Version.c
@echo -
@echo - NOTE: you must update Version.c by hand (use flags=$(OPT))
@echo -
nufxlib2.lib: $(OBJS)
if exist $(PRODUCT) del $(PRODUCT)
$(link) -lib /out:$(PRODUCT) $(OBJS) /nologo
clean::
-del *.obj
-del $(PRODUCT)
Archive.obj: Archive.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
ArchiveIO.obj: ArchiveIO.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Bzip2.obj: Bzip2.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Compress.obj: Compress.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Crc16.obj: Crc16.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Debug.obj: Debug.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Deferred.obj: Deferred.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Deflate.obj: Deflate.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Entry.obj: Entry.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Expand.obj: Expand.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
FileIO.obj: FileIO.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Funnel.obj: Funnel.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Lzc.obj: Lzc.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Lzw.obj: Lzw.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
MiscStuff.obj: MiscStuff.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
MiscUtils.obj: MiscUtils.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Record.obj: Record.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
SourceSink.obj: SourceSink.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Squeeze.obj: Squeeze.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Thread.obj: Thread.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Value.obj: Value.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h
Version.obj: Version.c NufxLibPriv.h NufxLib.h MiscStuff.h SysDefs.h