-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.msc
54 lines (39 loc) · 1.03 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
#
# Makefile for the Microsoft toolchain
#
# Usage:
# nmake /f Makefile.msc
#
CC = cl
LD = link
AR = lib
CFLAGS = /MD /O2 -I. -Icommon
LDFLAGS =
STATICLIB = libxpackstatic.lib
SHAREDLIB = libxpack.dll
IMPLIB = libxpack.lib
LIB_OBJ = lib/x86_cpu_features.obj \
lib/xpack_compress.obj \
lib/xpack_decompress.obj \
lib/xpack_common.obj
PROG_COMMON_OBJ = programs/prog_util.obj \
programs/tgetopt.obj \
$(STATICLIB)
PROG_CFLAGS = $(CFLAGS) -Iprograms
PROGRAMS = benchmark.exe xpack.exe xunpack.exe
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) $(PROGRAMS)
.c.obj:
$(CC) -c /Fo$@ $(CFLAGS) $**
$(STATICLIB): $(LIB_OBJ)
$(AR) $(ARFLAGS) -out:$@ $(LIB_OBJ)
$(SHAREDLIB): $(LIB_OBJ)
$(LD) $(LDFLAGS) -out:$@ -dll -implib:$(IMPLIB) $(LIB_OBJ)
$(IMPLIB): $(SHAREDLIB)
benchmark.exe:programs/benchmark.obj $(PROG_COMMON_OBJ)
$(LD) $(LDFLAGS) -out:$@ $**
xpack.exe:programs/xpack.obj $(PROG_COMMON_OBJ)
$(LD) $(LDFLAGS) -out:$@ $**
xunpack.exe:xpack.exe
copy $** $@
clean:
-del *.dll *.exe *.exp *.lib lib\*.obj programs\*.obj 2>nul