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