Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
lzma 1900 sdk Linux
OBJS = \
7zAlloc.o \
7zArcIn.o \
7zBuf.o \
7zBuf2.o \
7zCrc.o \
7zCrcOpt.o \
7zDec.o \
7zFile.o \
7zStream.o \
Aes.o \
AesOpt.o \
Alloc.o \
Bcj2.o \
Bcj2Enc.o \
Bra.o \
Bra86.o \
BraIA64.o \
CpuArch.o \
Delta.o \
LzFind.o \
Lzma2Dec.o \
Lzma2Enc.o \
Lzma86Dec.o \
Lzma86Enc.o \
LzmaDec.o \
LzmaEnc.o \
LzmaLib.o \
Ppmd7.o \
Ppmd7Dec.o \
Ppmd7Enc.o \
Sha256.o \
Sort.o \
Xz.o \
XzCrc64.o \
XzCrc64Opt.o \
XzDec.o \
XzEnc.o \
XzIn.o \
$(NULL)
# multi-threading
#LzFindMt.o \
#Lzma2DecMt.o \
#MtCoder.o \
#MtDec.o \
#Threads.o \
LIB = lib7z.a
SO = 7z.so
# single thread for now
DEFINES = -D_7ZIP_ST
CC ?= gcc
AR ?= ar
CFLAGS ?= -Wall -O2 -fPIC
all: $(LIB) $(SO)
clean:
rm -f $(SO) $(LIB) $(OBJS)
$(LIB): $(OBJS)
$(AR) crs $@ $^
$(SO): $(OBJS)
$(CC) -shared -o $@ $^ -Wl,-soname,$@ -Wl,--as-needed -Wl,-z,defs -s
%.o: C/%.c
$(CC) $(DEFINES) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment