Magellan Linux

Diff of /tags/grubby-8_40_20200707/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/mkinitrd-magellan/grubby/Makefile revision 532 by niro, Sat Sep 1 22:45:15 2007 UTC trunk/grubby/Makefile revision 3152 by niro, Tue Jul 7 11:28:10 2020 UTC
# Line 1  Line 1 
1  VERSION=$(shell cat ../VERSION)  #
2    # Makefile
3  ARCH := $(patsubst i%86,i386,$(shell uname -m))  #
4  ARCH := $(patsubst sparc%,sparc,$(ARCH))  # Copyright 2007-2009 Red Hat, Inc.  All rights reserved.
5  ARCH := $(patsubst ppc%,ppc,$(ARCH))  #
6    # This program is free software; you can redistribute it and/or modify
7  CFLAGS = -Wall -g $(CFLAGS) -DVERSION=\"$(VERSION)\"  # it under the terms of the GNU General Public License as published by
8  LDFLAGS = -g  # the Free Software Foundation; either version 2 of the License, or
9    # (at your option) any later version.
10  LOADLIBES = -lpopt  #
11    # This program is distributed in the hope that it will be useful,
12  all: grubby  # but WITHOUT ANY WARRANTY; without even the implied warranty of
13    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  test: all  # GNU General Public License for more details.
15   @./test.sh  #
16    # You should have received a copy of the GNU General Public License
17  install:    all  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   mkdir -p $(DESTDIR)/sbin  #
19   mkdir -p $(DESTDIR)/usr/share/man/man8  
20   install -m 755 new-kernel-pkg $(DESTDIR)/sbin  VERSION=$(shell cat VERSION)
21    
22    TARGETS = grubby
23    OBJECTS = grubby.o log.o
24    
25    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 :=
29    VERBOSE_TEST :=
30    ifneq ($(VERBOSE_TEST),)
31     VERBOSE_TEST="--verbose"
32    endif
33    
34    grubby_LIBS = -lblkid -lpopt
35    
36    PREFIX = /usr
37    sbindir = $(PREFIX)/sbin
38    mandir = /usr/share/man
39    
40    all: grubby
41    
42    debug : clean
43     $(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all
44    
45    %.o : %.c
46     $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $<
47    
48    test: all
49     @export TOPDIR=$(TOPDIR)
50     @./test.sh $(VERBOSE_TEST)
51    
52    install: all
53     mkdir -p $(DESTDIR)/$(sbindir)
54     mkdir -p $(DESTDIR)/$(mandir)/man8
55     install -m 755 new-kernel-pkg $(DESTDIR)/$(sbindir)
56     install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8
57     install -m 755 installkernel $(DESTDIR)/$(sbindir)
58     install -m 644 installkernel.8 $(DESTDIR)/$(mandir)/man8
59   if [ -f grubby ]; then \   if [ -f grubby ]; then \
60   install -m 755 grubby $(DESTDIR)/sbin ; \   install -m 755 grubby $(DESTDIR)/$(sbindir) ; \
61   install -m 644 grubby.8 $(DESTDIR)/usr/share/man/man8 ; \   install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \
62   fi   fi
63    
64  grubby: grubby.o mount_by_label.o  grubby:: $(OBJECTS)
65   $(CC) -o $@ $^ -Wl,-Bstatic $(LOADLIBES) -Wl,-Bdynamic $(CFLAGS) $(LDFLAGS)   $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS)
   
 %.o: %.c  
  $(CC) -c $(CFLAGS) -o $@ $<  
66    
67  clean:  clean:
68   rm -f grubby *.o   rm -f *.o grubby *~

Legend:
Removed from v.532  
changed lines
  Added in v.3152