github.com/grailbio/base@v0.0.11/compress/libdeflate/Makefile.msc (about) 1 # 2 # Makefile for the Microsoft toolchain 3 # 4 # Usage: 5 # nmake /f Makefile.msc 6 # 7 8 .SUFFIXES: .c .obj .dllobj 9 10 CC = cl 11 LD = link 12 AR = lib 13 CFLAGS = /MD /O2 -I. -Icommon 14 LDFLAGS = 15 16 STATIC_LIB = libdeflatestatic.lib 17 SHARED_LIB = libdeflate.dll 18 IMPORT_LIB = libdeflate.lib 19 20 STATIC_LIB_OBJ = \ 21 lib/aligned_malloc.obj \ 22 lib/adler32.obj \ 23 lib/crc32.obj \ 24 lib/deflate_compress.obj \ 25 lib/deflate_decompress.obj \ 26 lib/gzip_compress.obj \ 27 lib/gzip_decompress.obj \ 28 lib/x86/cpu_features.obj \ 29 lib/zlib_compress.obj \ 30 lib/zlib_decompress.obj 31 32 SHARED_LIB_OBJ = $(STATIC_LIB_OBJ:.obj=.dllobj) 33 34 PROG_COMMON_OBJ = programs/prog_util.obj \ 35 programs/tgetopt.obj \ 36 $(STATIC_LIB) 37 38 PROG_CFLAGS = $(CFLAGS) -Iprograms 39 40 all: $(STATIC_LIB) $(SHARED_LIB) $(IMPORT_LIB) gzip.exe gunzip.exe 41 42 .c.obj: 43 $(CC) -c /Fo$@ $(CFLAGS) $** 44 45 .c.dllobj: 46 $(CC) -c /Fo$@ $(CFLAGS) /DLIBDEFLATE_DLL $** 47 48 $(STATIC_LIB): $(STATIC_LIB_OBJ) 49 $(AR) $(ARFLAGS) -out:$@ $(STATIC_LIB_OBJ) 50 51 $(SHARED_LIB): $(SHARED_LIB_OBJ) 52 $(LD) $(LDFLAGS) -out:$@ -dll -implib:$(IMPORT_LIB) $(SHARED_LIB_OBJ) 53 54 $(IMPORT_LIB): $(SHARED_LIB) 55 56 gzip.exe:programs/gzip.obj $(PROG_COMMON_OBJ) 57 $(LD) $(LDFLAGS) -out:$@ $** 58 59 gunzip.exe:gzip.exe 60 copy $** $@ 61 62 clean: 63 -del *.dll *.exe *.exp libdeflate.lib libdeflatestatic.lib gzip.lib \ 64 lib\*.obj lib\*\*.obj lib\*.dllobj lib\*\*.dllobj \ 65 programs\*.obj 2>nul