Magellan Linux

Diff of /tags/grubby-8_18/Makefile

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

revision 547 by niro, Sun Sep 2 00:01:59 2007 UTC revision 1295 by niro, Fri May 27 14:41:01 2011 UTC
# Line 1  Line 1 
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)  VERSION=$(shell cat ../VERSION)
21    
22  ARCH := $(patsubst i%86,i386,$(shell uname -m))  TARGETS = grubby
23  ARCH := $(patsubst sparc%,sparc,$(ARCH))  OBJECTS = grubby.o
24  ARCH := $(patsubst ppc%,ppc,$(ARCH))  
25    CFLAGS := $(CFLAGS) $(RPM_OPT_FLAGS) -DVERSION='"$(VERSION)"' -Wall -Werror
26    LDFLAGS :=
27    
28  CFLAGS = -Wall -g $(OPTCFLAGS) -DVERSION=\"$(VERSION)\"  grubby_LIBS = -lblkid -lpopt
 LDFLAGS = -g  
29    
30  LOADLIBES = -lpopt  mandir = usr/share/man
31    
32  all: grubby  all: grubby
33    
34  test: all  test: all
35     @export TOPDIR=$(TOPDIR)
36   @./test.sh   @./test.sh
37    
38  install:    all  install: all
39   mkdir -p $(DESTDIR)/sbin   mkdir -p $(DESTDIR)/sbin
40   mkdir -p $(DESTDIR)/usr/share/man/man8   mkdir -p $(DESTDIR)/$(mandir)/man8
41   install -m 755 new-kernel-pkg $(DESTDIR)/sbin   install -m 755 new-kernel-pkg $(DESTDIR)/sbin
42     install -m 644 new-kernel-pkg.8 $(DESTDIR)/$(mandir)/man8
43   if [ -f grubby ]; then \   if [ -f grubby ]; then \
44   install -m 755 grubby $(DESTDIR)/sbin ; \   install -m 755 grubby $(DESTDIR)/sbin ; \
45   install -m 644 grubby.8 $(DESTDIR)/usr/share/man/man8 ; \   install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \
46   fi   fi
47    
48  grubby: grubby.o mount_by_label.o  grubby:: $(OBJECTS)
49   $(CC) -o $@ $^ -Wl,-Bstatic $(LOADLIBES) -Wl,-Bdynamic $(CFLAGS) $(LDFLAGS)   $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS)
   
 %.o: %.c  
  $(CC) -c $(CFLAGS) -o $@ $<  
50    
51  clean:  clean:
52   rm -f grubby *.o   rm -f *.o grubby *~

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