-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
57 lines (47 loc) · 1.65 KB
/
Makefile
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
###############################################################################
#
# "FastLZ" compression library
#
###############################################################################
FASTLZLIB_SRCS = fastlzlib.c
FASTLZ_SRCS := $(sort $(wildcard fastlz/*.c))
LZ4_SRCS := $(sort $(wildcard lz4/*.c))
SRCS = ${FASTLZLIB_SRCS} ${FASTLZ_SRCS} ${LZ4_SRCS}
TARGET_LIB = libfastlz.so
OBJS = $(SRCS:.c=.o)
CFLAGS = -fPIC -O3 -g -W -Wall -Wextra -Werror -Wno-unused-function -pthread -DZFAST_USE_LZ4 -DZFAST_USE_FASTLZ
LDFLAGS = -shared -rdynamic
RM = rm -f
all: fastlzcat
${TARGET_LIB}: $(OBJS)
$(CC) ${LDFLAGS} -Wl,-soname=libfastlz.so -o $@ $^
fastlzcat: ${TARGET_LIB} fastlzcat.o
$(CC) -o $@ $^ -L. -lfastlz
.PHONY: clean
clean:
-${RM} $(OBJS) *.o *.obj *.so* *.dll *.exe *.pdb *.exp *.lib fastlzcat
tar:
rm -f fastlzlib.tgz
tar cvfz fastlzlib.tgz fastlzlib.txt fastlzlib.c fastlzlib.h fastlzlib-zlib.h fastlzcat.c Makefile LICENSE
# to be started in a visual studio command prompt
visualcpp:
cl.exe -nologo -c -MD -O2 -W3 \
-D_WINDOWS -D_WIN32_WINNT=0x0400 -DWINVER=0x0400 \
-D_CRT_SECURE_NO_WARNINGS \
-DFASTLZ_DLL -DZFAST_USE_LZ4 -DZFAST_USE_FASTLZ \
$(SRCS)
link.exe -nologo -dll \
-out:fastlz.dll \
-implib:fastlz.lib \
-DEBUG -PDB:fastlz.pdb \
fastlzlib.obj fastlz.obj lz4.obj lz4hc.obj
mt.exe -nologo -manifest fastlz.dll.manifest \
"-outputresource:fastlz.dll;2"
cl.exe -nologo -MD -O2 -W3 \
-D_WINDOWS -D_WIN32_WINNT=0x0400 -DWINVER=0x0400 \
-D_CRT_SECURE_NO_WARNINGS \
-Fefastlzcat.exe \
fastlz.lib \
fastlzcat.c -link
mt.exe -nologo -manifest fastlzcat.exe.manifest \
"-outputresource:fastlzcat.exe;1"