1 CFLAGS=-Wall -W -Wextra -Werror -std=c99 -Ilib -Ielf -I. -Ilzma/api
3 LZMAFLAGS=-Ilzma/api -Ilzma/tuklib -Ilzma/lzma -Ilzma/common -Ilzma/check -Ilzma/lz -Ilzma/rangecoder -Ilzma/simple -Ilzma/delta -DHAVE_CHECK_CRC64 -DHAVE_CHECK_CRC32 -DHAVE_ENCODER_LZMA2 -DHAVE_DECODER_LZMA2 -DHAVE_MF_BT4
7 LZMACHECKSRC=lzma/check/check.c lzma/check/crc32_fast.c lzma/check/crc64_fast.c lzma/check/crc32_table.c lzma/check/crc64_table.c
8 LZMASRC=$(shell ls lzma/lzma/*.c lzma/common/*.c lzma/lz/*.c) $(LZMACHECKSRC) lzma/rangecoder/price_table.c
9 LZMAOBJ=$(filter-out lzma/common/stream_encoder_mt.o, $(LZMASRC:%.c=%.o))
13 ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \
18 printf '%s\n' $(LZMAOBJ)
25 gcc -std=c99 -Wall -c -o $@ $<
28 PATH=$(curdir)/t:$(curdir):$(PATH) t/$(T).t
31 PATH=$(curdir)/t:$(curdir):$(PATH) prove -e '' t/*.t
33 programs: elftype soname zpm-soneed zpm-addfile zpm-extract zpm-init \
34 zpm-vercmp zpm-findpkg
36 uncompress: uncompress.o
37 $(CC) $(CFLAGS) -o $@ $+ -llzma
39 elftype: elf/elftype.c
40 $(CC) $(CFLAGS) -o $@ $+
43 $(CC) -Ielf $(CFLAGS) -o $@ $+
45 zpm-soneed: elf/needed.c
46 $(CC) -Ielf $(CFLAGS) -o $@ $+
48 zpm-addfile: zpm-addfile.o libzpm.a libelf.a
49 $(CC) -Ielf $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
51 zpm-hash: zpm-hash.o libzpm.a
52 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
54 zpm-init: zpm-init.o libzpm.a
55 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
57 zpm-extract: zpm-extract.o libzpm.a
58 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
60 zpm-findpkg: zpm-findpkg.o libzpm.a
61 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
64 echo "char createdb[] = {" > $@
68 lib/sqlite3.o: lib/sqlite3.c lib/config.h
69 $(CC) -Wall -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
72 $(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $*.c
76 zpm-vercmp: zpm-vercmp.o lib/vercmp.o
77 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
79 libzpm.a: lib/sha256.o lib/db.o lib/compress.o lib/uncompress.o lib/zpm.o \
85 libelf.a: elf/libelf.o
89 install -D zpm $(DESTDIR)/bin/zpm
90 install -D zpm-note $(DESTDIR)/bin/zpm-note
91 install -D zpm-bug $(DESTDIR)/bin/zpm-bug
92 install -D zpm-sequence $(DESTDIR)/bin/zpm-sequence
93 install -D zpm-preserve $(DESTDIR)/bin/zpm-preserve
94 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin
95 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin/notes
96 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin/notes/open
97 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin/notes/ack
98 install -D elftype $(DESTDIR)/usr/sbin/elftype
99 install -D soname $(DESTDIR)/usr/sbin/soname
100 #SPOOL=$(DESTDIR)/var/lib/admin/notes ./zpm-sequence -c notes
103 rm -f *.o lib/*.o $(LZMAOBJ) liblzma.a libelf.a libzpm.a zpm-addfile soname