Magellan Linux

Diff of /tags/grubby-8_30/Makefile

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

trunk/mkinitrd-magellan/grubby/Makefile revision 547 by niro, Sun Sep 2 00:01:59 2007 UTC trunk/grubby/Makefile revision 2264 by niro, Mon Oct 21 14:11:43 2013 UTC
# Line 1  Line 1 
1  VERSION=$(shell cat ../VERSION)  #
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 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    
30    grubby_LIBS = -lblkid -lpopt
31    
32    PREFIX = /usr
33    sbindir = $(PREFIX)/sbin
34    mandir = /usr/share/man
35    
36    all: grubby
37    
38  ARCH := $(patsubst i%86,i386,$(shell uname -m))  debug : clean
39  ARCH := $(patsubst sparc%,sparc,$(ARCH))   $(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all
 ARCH := $(patsubst ppc%,ppc,$(ARCH))  
40    
41  CFLAGS = -Wall -g $(OPTCFLAGS) -DVERSION=\"$(VERSION)\"  %.o : %.c
42  LDFLAGS = -g   $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $<
43    
44  LOADLIBES = -lpopt  test: all
45     @export TOPDIR=$(TOPDIR)
 all: grubby  
   
 test: all  
46   @./test.sh   @./test.sh
47    
48  install:    all  install: all
49   mkdir -p $(DESTDIR)/sbin   mkdir -p $(DESTDIR)/$(sbindir)
50   mkdir -p $(DESTDIR)/usr/share/man/man8   mkdir -p $(DESTDIR)/$(mandir)/man8
51   install -m 755 new-kernel-pkg $(DESTDIR)/sbin   install -m 755 new-kernel-pkg $(DESTDIR)/$(sbindir)
52     install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8
53     install -m 755 installkernel $(DESTDIR)/$(sbindir)
54     install -m 644 installkernel.8 $(DESTDIR)/$(mandir)/man8
55   if [ -f grubby ]; then \   if [ -f grubby ]; then \
56   install -m 755 grubby $(DESTDIR)/sbin ; \   install -m 755 grubby $(DESTDIR)/$(sbindir) ; \
57   install -m 644 grubby.8 $(DESTDIR)/usr/share/man/man8 ; \   install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \
58   fi   fi
59    
60  grubby: grubby.o mount_by_label.o  grubby:: $(OBJECTS)
61   $(CC) -o $@ $^ -Wl,-Bstatic $(LOADLIBES) -Wl,-Bdynamic $(CFLAGS) $(LDFLAGS)   $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS)
   
 %.o: %.c  
  $(CC) -c $(CFLAGS) -o $@ $<  
62    
63  clean:  clean:
64   rm -f grubby *.o   rm -f *.o grubby *~

Legend:
Removed from v.547  
changed lines
  Added in v.2264