1 CFLAGS=-Wall -std=c99 -Ilib -Ielf -I.
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
16 printf '%s\n' $(LZMAOBJ)
23 gcc -std=c99 -Wall -c -o $@ $<
26 PATH=$(curdir)/t:$(curdir):$(PATH) t/$(T).t
29 PATH=$(curdir)/t:$(curdir):$(PATH) prove -e '' t/*.t
31 programs: elftype soname zpm-soneed zpm-addfile zpm-extract zpm-init zpm-vercmp
33 uncompress: uncompress.o
34 $(CC) $(CFLAGS) -o $@ $+ -llzma
36 elftype: elf/elftype.c
37 $(CC) $(CFLAGS) -o $@ $+
40 $(CC) -Ielf $(CFLAGS) -o $@ $+
42 zpm-soneed: elf/needed.c
43 $(CC) -Ielf $(CFLAGS) -o $@ $+
45 zpm-addfile: zpm-addfile.o libzpm.a libelf.a
46 $(CC) -Ielf $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
48 zpm-hash: zpm-hash.o libzpm.a
49 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
51 zpm-init: zpm-init.o libzpm.a
52 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
54 zpm-extract: zpm-extract.o libzpm.a
55 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
58 echo "char createdb[] = {" > $@
62 lib/sqlite3.o: lib/sqlite3.c lib/config.h
63 $(CC) $(CFLAGS) -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
66 $(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $*.c
71 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
73 libzpm.a: lib/sha256.o lib/db.o lib/compress.o lib/uncompress.o lib/zpm.o \
78 libelf.a: elf/libelf.o
82 install -D zpm $(DESTDIR)/bin/zpm
83 install -D zpm-note $(DESTDIR)/bin/zpm-note
84 install -D zpm-bug $(DESTDIR)/bin/zpm-bug
85 install -D zpm-sequence $(DESTDIR)/bin/zpm-sequence
86 install -D zpm-preserve $(DESTDIR)/bin/zpm-preserve
87 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin
88 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin/notes
89 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin/notes/open
90 install -d -m2770 -o root -g adm $(DESTDIR)/var/lib/admin/notes/ack
91 install -D elftype $(DESTDIR)/usr/sbin/elftype
92 install -D soname $(DESTDIR)/usr/sbin/soname
93 #SPOOL=$(DESTDIR)/var/lib/admin/notes ./zpm-sequence -c notes
96 rm -f *.o lib/*.o $(LZMAOBJ) liblzma.a libelf.a libzpm.a zpm-addfile soname