Magellan Linux

Contents of /trunk/grubby/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1694 - (show annotations) (download)
Fri Feb 17 23:23:07 2012 UTC (12 years, 8 months ago) by niro
File size: 1656 byte(s)
Tweak some make options.

Some functions are only used in dbgPrintf() arguments. As such,
errors/warnings on unused functions need to be disabled.

Also, use -std=gnu99.

Also, add a debug target.


1 #
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 VERSION=$(shell cat VERSION)
21
22 TARGETS = grubby
23 OBJECTS = grubby.o
24
25 CC = gcc
26 CFLAGS += $(RPM_OPT_FLAGS) -std=gnu99 -Wall -Werror -Wno-error=unused-function -Wno-unused-function
27 LDFLAGS :=
28
29 grubby_LIBS = -lblkid -lpopt
30
31 mandir = usr/share/man
32
33 all: grubby
34
35 debug : clean
36 $(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all
37
38 %.o : %.c
39 $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $<
40
41 test: all
42 @export TOPDIR=$(TOPDIR)
43 @./test.sh
44
45 install: all
46 mkdir -p $(DESTDIR)/sbin
47 mkdir -p $(DESTDIR)/$(mandir)/man8
48 install -m 755 new-kernel-pkg $(DESTDIR)/sbin
49 install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8
50 install -m 755 installkernel $(DESTDIR)/sbin
51 install -m 644 installkernel.8 $(DESTDIR)/$(mandir)/man8
52 if [ -f grubby ]; then \
53 install -m 755 grubby $(DESTDIR)/sbin ; \
54 install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \
55 fi
56
57 grubby:: $(OBJECTS)
58 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS)
59
60 clean:
61 rm -f *.o grubby *~