X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=Makefile;h=85a5d13dcce9ba837bc686260b5e0d4ebf53026f;hp=ab71151269dc6078e65ab9b18fed59b5cda93d32;hb=89a160b4762730e078ed8d2e5c212a51f17ac6f8;hpb=18aedfeb9f09db2e38d53083066967caf955875c diff --git a/Makefile b/Makefile index ab71151..85a5d13 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ -CC=clang +CC=clang --target=x86_64-pc-linux-musl #CC=/usr/musl/bin/musl-gcc -CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api +CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api --target=x86_64-pc-linux-musl ZPMVER:=$(shell git describe --tags --match 'v[0-9]*' | sed -e 's/^v//' | sed -e 's/-g.\+//' | sed -e 's/-/./g') 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. -static +LDFLAGS=-fuse-ld=lld -L. -static 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 LZMASRC=$(shell ls lzma/lzma/*.c lzma/common/*.c lzma/lz/*.c) $(LZMACHECKSRC) lzma/rangecoder/price_table.c @@ -33,7 +33,8 @@ ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \ SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-preserve zpm-test zpm-log \ zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \ - zpm-pkg zpm-add zpm-pkgfile zpm-gc zpm-repo + zpm-pkg zpm-add zpm-pkgfile zpm-gc zpm-repo zpm-update zpm-confgit +MANPAGES=doc/zpm.8 $(addprefix doc/zpm-, list.8 contents.8 hash.8 quote.8 pathmod.8 ) COMPILED=$(ZPKGBIN) PROGRAMS=$(SCRIPTS) $(COMPILED) @@ -72,11 +73,11 @@ lib/libjsw.a: $(JSWOBJ) ZPM:= ./zpm -P. -zpm-$(ZPMVER)-1.zpm: programs doc/zpm.8 +zpm-$(ZPMVER)-1.zpm: programs $(MANPAGES) rm -f $@ $(ZPM) newpackage -C zpm-$(ZPMVER)-1 $(ZPM) add -v -u root -g root -f $@ -P /sbin zpm-$(ZPMVER)-1 $(sort $(PROGRAMS)) - $(ZPM) add -v -u root -g root -f $@ -P /usr/share/man/man8 -S doc doc/zpm.8 + $(ZPM) add -v -u root -g root -f $@ -P /usr/share/man/man8 -S doc $(MANPAGES) tarball: zpm-$(ZPMVER)-1.tar.xz @@ -95,7 +96,7 @@ stest: $(ZPKGBIN) PATH=$(curdir)/t:$(curdir):$(PATH) t/$(T).t t/ctap/prove: t/ctap/prove.o - $(CC) $(CFLAGS) -o $@ $+ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ test: $(ZPKGBIN) t/ctap/prove @PATH=$(curdir)/t:$(curdir):$(PATH) t/ctap/prove t/*.t @@ -159,6 +160,11 @@ zpm-parse: zpm-parse.o lib/parse.o zpm-quote: zpm-quote.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< +db.sql: schema/main.sql schema/syncconflicts.sql schema/syncinfo.sql + echo 'begin;' > $@ + cat $+ >> $@ + echo 'commit;' >> $@ + newdb.c: db.sql echo "char createdb[] = {" > $@ xxd -i < $< >> $@ @@ -187,11 +193,11 @@ zpm-shell: sqlite/sqlite3.o sqlite/shell.o sqlite/extensions.o lib/vercmp.o libelf.a: elf/libelf.o ar rcuv $@ $? -install: $(COMPILED) doc/zpm.8 +install: $(COMPILED) $(MANPAGES) test -d $(DESTDIR)/sbin || install -d $(DESTDIR)/sbin install $(PROGRAMS) $(DESTDIR)/sbin mkdir -p $(DESTDIR)/usr/share/man/man8 - install -m644 doc/zpm.8 $(DESTDIR)/usr/share/man/man8 + install -m644 $(MANPAGES) $(DESTDIR)/usr/share/man/man8 scan-prep: clean sqlite/sqlite3.o sqlite/shell.o lib/liblzma.a @echo scan-build -v -o report make -j10 @@ -200,4 +206,8 @@ clean: rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \ libelf.a libzpm.a zpm-addfile soname \ *.xz \ - local.db t/ctap/prove.o $(ZPKGBIN) + local.db \ + t/ctap/*.o \ + $(ZPKGBIN) \ + db.sql \ + elf/*.o lib/jsw/*.o