Annotation of /trunk/grubby/Makefile
Parent Directory | Revision Log
Revision 3169 -
(hide annotations)
(download)
Thu Jul 27 14:27:01 2023 UTC (13 months, 4 weeks ago) by niro
File size: 1977 byte(s)
Thu Jul 27 14:27:01 2023 UTC (13 months, 4 weeks ago) by niro
File size: 1977 byte(s)
Add grubby-bls script (#35) - 2018-06-18
1 | niro | 914 | # |
2 | # Makefile | ||
3 | # | ||
4 | # Copyright 2007-2009 Red Hat, Inc. All rights reserved. | ||
5 | # | ||
6 | # This program is free software; you can redistribute it and/or modify | ||
7 | # it under the terms of the GNU General Public License as published by | ||
8 | # the Free Software Foundation; either version 2 of the License, or | ||
9 | # (at your option) any later version. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License | ||
17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | # | ||
19 | |||
20 | niro | 1335 | VERSION=$(shell cat VERSION) |
21 | niro | 532 | |
22 | niro | 914 | TARGETS = grubby |
23 | niro | 2236 | OBJECTS = grubby.o log.o |
24 | niro | 532 | |
25 | niro | 1694 | CC = gcc |
26 | niro | 2261 | RPM_OPT_FLAGS ?= -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector |
27 | niro | 1695 | CFLAGS += $(RPM_OPT_FLAGS) -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function -ggdb |
28 | niro | 914 | LDFLAGS := |
29 | niro | 2997 | VERBOSE_TEST := |
30 | ifneq ($(VERBOSE_TEST),) | ||
31 | VERBOSE_TEST="--verbose" | ||
32 | endif | ||
33 | niro | 532 | |
34 | niro | 914 | grubby_LIBS = -lblkid -lpopt |
35 | niro | 532 | |
36 | niro | 2264 | PREFIX = /usr |
37 | sbindir = $(PREFIX)/sbin | ||
38 | niro | 1869 | mandir = /usr/share/man |
39 | niro | 937 | |
40 | niro | 914 | all: grubby |
41 | niro | 532 | |
42 | niro | 1694 | debug : clean |
43 | $(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all | ||
44 | |||
45 | %.o : %.c | ||
46 | $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $< | ||
47 | |||
48 | niro | 914 | test: all |
49 | @export TOPDIR=$(TOPDIR) | ||
50 | niro | 2997 | @./test.sh $(VERBOSE_TEST) |
51 | niro | 3169 | @./test-bls.sh $(VERBOSE_TEST) |
52 | niro | 532 | |
53 | niro | 914 | install: all |
54 | niro | 1869 | mkdir -p $(DESTDIR)/$(sbindir) |
55 | niro | 914 | mkdir -p $(DESTDIR)/$(mandir)/man8 |
56 | niro | 1869 | install -m 755 new-kernel-pkg $(DESTDIR)/$(sbindir) |
57 | niro | 1153 | install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8 |
58 | niro | 1869 | install -m 755 installkernel $(DESTDIR)/$(sbindir) |
59 | niro | 1339 | install -m 644 installkernel.8 $(DESTDIR)/$(mandir)/man8 |
60 | niro | 3169 | install -m 755 grubby-bls $(DESTDIR)$(PREFIX)/sbin |
61 | niro | 532 | if [ -f grubby ]; then \ |
62 | niro | 1869 | install -m 755 grubby $(DESTDIR)/$(sbindir) ; \ |
63 | niro | 914 | install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \ |
64 | niro | 532 | fi |
65 | |||
66 | niro | 914 | grubby:: $(OBJECTS) |
67 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS) | ||
68 | niro | 532 | |
69 | clean: | ||
70 | niro | 914 | rm -f *.o grubby *~ |