add libcustr/libofmt to installer
[unleashed-kayak.git] / Makefile
blobaba57d1c212529e4feffd6c4aa7827a9123ea65d
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
16 VERSION?=$(shell awk '$$1 == "unleashed" { print $$2 }' /etc/release)
17 BUILDSEND=rpool/kayak_image
19 BUILDSEND_MP=$(shell zfs get -o value -H mountpoint $(BUILDSEND))
21 all:
23 anon.dtrace.conf:
24 dtrace -A -q -n'int seen[string]; fsinfo:::/args[0]->fi_mount=="/" && seen[args[0]->fi_pathname]==0/{printf("%d %s\n",timestamp/1000000, args[0]->fi_pathname);seen[args[0]->fi_pathname]=1;}' -o $@.tmp
25 cat /kernel/drv/dtrace.conf $@.tmp > $@
26 rm $@.tmp
28 MINIROOT_DEPS=install.sh ksh.profile anon.dtrace.conf anon.system
30 $(BUILDSEND_MP)/kayak_$(VERSION).zfs: build_zfs_send.sh
31 @test -d "$(BUILDSEND_MP)" || (echo "$(BUILDSEND) missing" && false)
32 ./build_zfs_send.sh -d $(BUILDSEND) $(VERSION)
34 build_image.sh:
35 VERSION=$(VERSION) ./build_image.sh
37 build_zfs_send.sh:
38 VERSION=$(VERSION) ./build_zfs_image.sh
40 $(BUILDSEND_MP)/miniroot.gz: $(MINIROOT_DEPS)
41 if test -n "`zfs list -H -t snapshot $(BUILDSEND)/root@fixup 2>/dev/null`"; then \
42 VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) fixup ; \
43 else \
44 VERSION=$(VERSION) DEBUG=$(DEBUG) ./build_image.sh $(BUILDSEND) begin ; \
47 mount_media: src/mount_media.c
48 gcc -o $@ $< -ldevinfo
50 install-iso: $(BUILDSEND_MP)/$(VERSION).iso
51 $(BUILDSEND_MP)/$(VERSION).iso: mount_media $(BUILDSEND_MP)/miniroot.gz $(BUILDSEND_MP)/kayak_$(VERSION).zfs
52 BUILDSEND_MP=$(BUILDSEND_MP) VERSION=$(VERSION) ./build_iso.sh
54 install-usb: $(BUILDSEND_MP)/$(VERSION).img
55 $(BUILDSEND_MP)/$(VERSION).img: $(BUILDSEND_MP)/$(VERSION).iso
56 ./usbgen.sh $(BUILDSEND_MP)/$(VERSION).iso $(BUILDSEND_MP)/$(VERSION).img /tmp