CFLAGS=-Wall -W -Wextra -Werror -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api
+ZPMVER:=$(shell git tag --list 'v[0-9]*' | sed -e 's/^v//' | sort -nr | head -1)
+ifeq ($(strip $(ZPMVER)),)
+ ZPMVER:=0.1
+endif
+
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
LDFLAGS=-L. -ldl
curdir=$(shell pwd)
ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \
- zpm-findpkg zpm-shell
+ zpm-findpkg zpm-shell zpm-soneed
+
+SCRIPTS=zpm zpm-install
+COMPILED=$(ZPKGBIN)
+PROGRAMS=$(SCRIPTS) $(COMPILED)
def: programs
d:
printf '%s\n' $(LZMAOBJ)
printf '%s\n' $(PATH)
+package: zpm-0.1-1.zpm
+
+ZPM:= ./zpm -P scripts:bin:.
+
+zpm-0.1-1.zpm: programs scripts
+ rm -f $@
+ ./zpm -P scripts:bin:. newpackage -f $@ -v 0.1 zpm
+ ./zpm -P scripts:bin:. addtopackage -f $@ -P /usr/libexec/zpm -v 0.1 zpm $(PROGRAMS)
+
+tarball: zpm-0.1-1.tar.xz
+
+zpm-0.1-1.tar.xz: programs scripts
+ rm -f $@
+ tar -cJf $@ --transform='s|^|usr/libexec/zpm/|' \
+ --transform='s|^usr/libexec/zpm/zpm$$|usr/bin/zpm|' \
+ $(PROGRAMS)
+
lzma.c: mklzma
sh mklzma