VERSION=$(shell cat ../VERSION) ARCH := $(patsubst i%86,i386,$(shell uname -m)) ARCH := $(patsubst sparc%,sparc,$(ARCH)) ARCH := $(patsubst ppc%,ppc,$(ARCH)) CFLAGS = -Wall -g $(CFLAGS) -DVERSION=\"$(VERSION)\" LDFLAGS = -g LOADLIBES = -lpopt all: grubby test: all @./test.sh install: all mkdir -p $(DESTDIR)/sbin mkdir -p $(DESTDIR)/usr/share/man/man8 install -m 755 new-kernel-pkg $(DESTDIR)/sbin if [ -f grubby ]; then \ install -m 755 grubby $(DESTDIR)/sbin ; \ install -m 644 grubby.8 $(DESTDIR)/usr/share/man/man8 ; \ fi grubby: grubby.o mount_by_label.o $(CC) -o $@ $^ -Wl,-Bstatic $(LOADLIBES) -Wl,-Bdynamic $(CFLAGS) $(LDFLAGS) %.o: %.c $(CC) -c $(CFLAGS) -o $@ $< clean: rm -f grubby *.o