17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
# |
# |
19 |
|
|
20 |
VERSION=$(shell cat ../VERSION) |
VERSION=$(shell cat VERSION) |
21 |
|
|
22 |
TARGETS = grubby |
TARGETS = grubby |
23 |
OBJECTS = grubby.o |
OBJECTS = grubby.o log.o |
24 |
|
|
25 |
CFLAGS := $(CFLAGS) $(RPM_OPT_FLAGS) -DVERSION='"$(VERSION)"' -Wall -Werror |
CC = gcc |
26 |
|
RPM_OPT_FLAGS ?= -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector |
27 |
|
CFLAGS += $(RPM_OPT_FLAGS) -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function -ggdb |
28 |
LDFLAGS := |
LDFLAGS := |
29 |
|
|
30 |
grubby_LIBS = -lblkid -lpopt |
grubby_LIBS = -lblkid -lpopt |
31 |
grubby_LIBS += $(shell pkg-config --libs glib-2.0) |
|
32 |
|
sbindir = /usr/sbin |
33 |
|
mandir = /usr/share/man |
34 |
|
|
35 |
all: grubby |
all: grubby |
36 |
|
|
37 |
|
debug : clean |
38 |
|
$(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all |
39 |
|
|
40 |
|
%.o : %.c |
41 |
|
$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $< |
42 |
|
|
43 |
test: all |
test: all |
44 |
@export TOPDIR=$(TOPDIR) |
@export TOPDIR=$(TOPDIR) |
45 |
@./test.sh |
@./test.sh |
46 |
|
|
47 |
install: all |
install: all |
48 |
mkdir -p $(DESTDIR)/sbin |
mkdir -p $(DESTDIR)/$(sbindir) |
49 |
mkdir -p $(DESTDIR)/$(mandir)/man8 |
mkdir -p $(DESTDIR)/$(mandir)/man8 |
50 |
install -m 755 new-kernel-pkg $(DESTDIR)/sbin |
install -m 755 new-kernel-pkg $(DESTDIR)/$(sbindir) |
51 |
install -m 755 installkernel $(DESTDIR)/sbin |
install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8 |
52 |
|
install -m 755 installkernel $(DESTDIR)/$(sbindir) |
53 |
|
install -m 644 installkernel.8 $(DESTDIR)/$(mandir)/man8 |
54 |
if [ -f grubby ]; then \ |
if [ -f grubby ]; then \ |
55 |
install -m 755 grubby $(DESTDIR)/sbin ; \ |
install -m 755 grubby $(DESTDIR)/$(sbindir) ; \ |
56 |
install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \ |
install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \ |
57 |
fi |
fi |
58 |
|
|