6 TWIN_CFLAGS?=$(shell pkg-config --cflags libtwin)
7 TWIN_LDFLAGS?=$(shell pkg-config --libs libtwin)
10 CFLAGS = --std=c99 -O0 -ggdb -Wall '-DPREFIX="$(PREFIX)"'
12 PARSERS = native yaboot kboot
13 ARTWORK = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz
15 all: petitboot udev-helper
17 petitboot: petitboot.o devices.o
18 $(CC) $(LDFLAGS) -o $@ $^
20 petitboot: LDFLAGS+=$(TWIN_LDFLAGS)
21 petitboot: CFLAGS+=$(TWIN_CFLAGS)
23 udev-helper: devices/udev-helper.o devices/params.o devices/parser.o \
24 devices/yaboot-cfg.o \
25 $(foreach p,$(PARSERS),devices/$(p)-parser.o)
26 $(CC) $(LDFLAGS) -o $@ $^
28 parser-test: devices/parser-test.o devices/params.o devices/parser.o \
29 devices/yaboot-cfg.o \
30 $(foreach p,$(PARSERS),devices/$(p)-parser.o)
31 $(CC) $(LDFLAGS) -o $@ $^
33 devices/%: CFLAGS+=-I.
36 $(INSTALL) -D petitboot $(DESTDIR)$(PREFIX)/sbin/petitboot
37 $(INSTALL) -D udev-helper $(DESTDIR)$(PREFIX)/sbin/udev-helper
38 $(INSTALL) -Dd $(DESTDIR)$(PREFIX)/share/petitboot/artwork/
39 $(INSTALL) -t $(DESTDIR)$(PREFIX)/share/petitboot/artwork/ \
40 $(foreach a,$(ARTWORK),artwork/$(a))
42 dist: $(PACKAGE)-$(VERSION).tar.gz
44 $(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION)
47 $(PACKAGE)-$(VERSION): clean
51 cp -a devices/*.[ch] $@/devices/