Makefile revision 1.9 1 1.9 christos # $NetBSD: Makefile,v 1.9 2018/06/02 01:40:52 christos Exp $
2 1.6 christos
3 1.6 christos .include <bsd.init.mk>
4 1.1 joerg
5 1.1 joerg LIB= lzma
6 1.1 joerg USE_SHLIBDIR= yes
7 1.1 joerg NOLINT= yes
8 1.1 joerg
9 1.1 joerg
10 1.5 christos .PATH: ${XZSRCDIR}/src/liblzma/api ${XZSRCDIR}/src/liblzma/api/lzma
11 1.2 joerg INCS+= base.h bcj.h block.h check.h container.h delta.h \
12 1.5 christos filter.h hardware.h index.h index_hash.h lzma.h lzma12.h \
13 1.5 christos stream_flags.h version.h vli.h
14 1.2 joerg
15 1.5 christos INCSDIR_lzma.h= /usr/include
16 1.2 joerg INCSDIR= /usr/include/lzma
17 1.2 joerg
18 1.9 christos .if ${MKSANITIZER} != "yes"
19 1.1 joerg LDFLAGS+= -Wl,-z,defs
20 1.9 christos .endif
21 1.1 joerg
22 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/check
23 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/common
24 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/delta
25 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/lz
26 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/lzma
27 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/rangecoder
28 1.1 joerg CPPFLAGS+= -I${XZSRCDIR}/src/liblzma/simple
29 1.1 joerg CPPFLAGS+= -DTUKLIB_SYMBOL_PREFIX=lzma_
30 1.1 joerg CPPFLAGS+= -DNETBSD_NATIVE_SHA256
31 1.1 joerg
32 1.1 joerg .PATH: ${XZSRCDIR}/src/common
33 1.4 christos SRCS+= tuklib_physmem.c tuklib_cpucores.c
34 1.1 joerg
35 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/check
36 1.1 joerg SRCS+= check.c crc32_table.c crc64_table.c
37 1.1 joerg SRCS+= crc32_fast.c crc64_fast.c
38 1.1 joerg
39 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/common
40 1.1 joerg SRCS+= common.c block_util.c easy_preset.c filter_common.c \
41 1.4 christos hardware_physmem.c hardware_cputhreads.c index.c \
42 1.1 joerg stream_flags_common.c vli_size.c \
43 1.1 joerg alone_encoder.c block_buffer_encoder.c block_encoder.c \
44 1.3 joerg block_header_encoder.c easy_buffer_encoder.c easy_encoder.c \
45 1.1 joerg easy_encoder_memusage.c filter_buffer_encoder.c \
46 1.1 joerg filter_encoder.c filter_flags_encoder.c index_encoder.c \
47 1.4 christos stream_buffer_encoder.c stream_encoder.c stream_encoder_mt.c \
48 1.4 christos stream_flags_encoder.c vli_encoder.c outqueue.c \
49 1.1 joerg alone_decoder.c auto_decoder.c block_buffer_decoder.c \
50 1.1 joerg block_decoder.c block_header_decoder.c easy_decoder_memusage.c \
51 1.1 joerg filter_buffer_decoder.c filter_decoder.c filter_flags_decoder.c \
52 1.1 joerg index_decoder.c index_hash.c stream_buffer_decoder.c \
53 1.1 joerg stream_decoder.c stream_flags_decoder.c vli_decoder.c
54 1.1 joerg
55 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/delta
56 1.1 joerg SRCS+= delta_common.c delta_encoder.c delta_decoder.c
57 1.1 joerg
58 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/lz
59 1.1 joerg SRCS+= lz_decoder.c lz_encoder.c lz_encoder_mf.c
60 1.1 joerg
61 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/lzma
62 1.1 joerg SRCS+= lzma_encoder.c lzma_encoder_presets.c \
63 1.1 joerg lzma_encoder_optimum_fast.c lzma_encoder_optimum_normal.c \
64 1.1 joerg lzma_decoder.c lzma2_encoder.c lzma2_decoder.c \
65 1.1 joerg fastpos_table.c
66 1.1 joerg
67 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/rangecoder
68 1.1 joerg SRCS+= price_table.c
69 1.1 joerg
70 1.1 joerg .PATH: ${XZSRCDIR}/src/liblzma/simple
71 1.1 joerg SRCS+= simple_coder.c simple_encoder.c simple_decoder.c \
72 1.1 joerg arm.c armthumb.c ia64.c powerpc.c sparc.c x86.c
73 1.1 joerg
74 1.1 joerg liblzma.pc: ${XZSRCDIR}/src/liblzma/liblzma.pc.in
75 1.1 joerg ${_MKTARGET_CREATE}
76 1.1 joerg rm -f ${.TARGET}
77 1.1 joerg ${TOOL_SED} \
78 1.1 joerg -e 's,@prefix@,/usr,' \
79 1.1 joerg -e 's,@exec_prefix@,/usr,' \
80 1.1 joerg -e 's,@libdir@,/usr/lib,' \
81 1.1 joerg -e 's,@includedir@,/usr/include,' \
82 1.1 joerg -e 's,@PACKAGE_HOMEPAGE@,${XZHOMEPAGE:Q},' \
83 1.1 joerg -e 's,@PACKAGE_VERSION@,${XZVERSION:Q},' \
84 1.1 joerg -e 's,@PTHREAD_CFLAGS@ @PTHREAD_LIBS@,,' \
85 1.1 joerg < ${XZSRCDIR}/src/liblzma/liblzma.pc.in \
86 1.1 joerg > ${.TARGET}.tmp && \
87 1.1 joerg mv -f ${.TARGET}.tmp ${.TARGET}
88 1.1 joerg
89 1.7 christos .if ${MACHINE_ARCH} == "i386"
90 1.8 maya COPTS += ${${ACTIVE_CC} == "gcc":? -Wno-error=psabi :}
91 1.7 christos .endif
92 1.7 christos
93 1.1 joerg CLEANFILES+= liblzma.pc
94 1.1 joerg
95 1.6 christos LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
96 1.4 christos
97 1.1 joerg .include <bsd.lib.mk>
98