summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-04-02 13:54:11 +1000
committerJeremy Kerr <jk@ozlabs.org>2007-04-02 13:54:11 +1000
commitdb8001f511f8e8d928aa82113431067f968f4966 (patch)
treeebaff8f3ee26574b29f444674814987c604db10d /Makefile
parent49d43d590027df23d45d3cd99f83517eeab67a43 (diff)
downloadtalos-petitboot-db8001f511f8e8d928aa82113431067f968f4966.tar.gz
talos-petitboot-db8001f511f8e8d928aa82113431067f968f4966.zip
Make petitboot installable
Add an install target and PREFIX= option the makefile, and change the artwork loading code to use the prefixed-path. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 669e56a..a9ae25c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,14 @@
+PREFIX?=/usr
CC=gcc
+INSTALL=install
TWIN_CFLAGS=$(shell pkg-config --cflags libtwin)
TWIN_LDFLAGS=$(shell pkg-config --libs libtwin)
LDFLAGS =
-CFLAGS = -O0 -ggdb -Wall
+CFLAGS = -O0 -ggdb -Wall '-DPREFIX="$(PREFIX)"'
PARSERS = native
+ARTWORK = background.png cdrom.png hdd.png usbpen.png cursor
all: petitboot udev-helper
@@ -19,6 +22,15 @@ udev-helper: devices/udev-helper.o devices/params.o \
$(foreach p,$(PARSERS),devices/$(p)-parser.o)
$(CC) $(LDFLAGS) -o $@ $^
+devices/%: CFLAGS+=-I.
+
+install: all
+ $(INSTALL) -D petitboot $(PREFIX)/sbin/petitboot
+ $(INSTALL) -D udev-helper $(PREFIX)/sbin/udev-helper
+ $(INSTALL) -Dd $(PREFIX)/share/petitboot/artwork/
+ $(INSTALL) -t $(PREFIX)/share/petitboot/artwork/ \
+ $(foreach a,$(ARTWORK),artwork/$(a))
+
clean:
rm -f petitboot
rm -f udev-helper
OpenPOWER on IntegriCloud