X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=Makefile;h=21bbd1b3f2c7ad018d2330b48b25a4f9ebd67f8f;hp=669e56a8210834994394dad86e7a41a0d318c03f;hb=d353f6e823d5b8cb949e20ae1139a5b7fbb0478b;hpb=49d43d590027df23d45d3cd99f83517eeab67a43 diff --git a/Makefile b/Makefile index 669e56a..21bbd1b 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,16 @@ +PREFIX?=/usr +VERSION=0.0.1 +PACKAGE=petitboot CC=gcc -TWIN_CFLAGS=$(shell pkg-config --cflags libtwin) -TWIN_LDFLAGS=$(shell pkg-config --libs libtwin) +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 +PARSERS = native yaboot kboot +ARTWORK = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz all: petitboot udev-helper @@ -15,10 +20,31 @@ petitboot: petitboot.o devices.o petitboot: LDFLAGS+=$(TWIN_LDFLAGS) petitboot: CFLAGS+=$(TWIN_CFLAGS) -udev-helper: devices/udev-helper.o devices/params.o \ +udev-helper: devices/udev-helper.o devices/params.o devices/yaboot-cfg.o \ $(foreach p,$(PARSERS),devices/$(p)-parser.o) $(CC) $(LDFLAGS) -o $@ $^ +devices/%: CFLAGS+=-I. + +install: all + $(INSTALL) -D petitboot $(DESTDIR)$(PREFIX)/sbin/petitboot + $(INSTALL) -D udev-helper $(DESTDIR)$(PREFIX)/sbin/udev-helper + $(INSTALL) -Dd $(DESTDIR)$(PREFIX)/share/petitboot/artwork/ + $(INSTALL) -t $(DESTDIR)$(PREFIX)/share/petitboot/artwork/ \ + $(foreach a,$(ARTWORK),artwork/$(a)) + +dist: $(PACKAGE)-$(VERSION).tar.gz + +$(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION) + tar czvf $@ $^ + +$(PACKAGE)-$(VERSION): clean + mkdir $@ $@/devices + cp -a artwork $@ + cp *.[ch] $@ + cp -a devices/*.[ch] $@/devices/ + cp Makefile $@ + clean: rm -f petitboot rm -f udev-helper