Home | History | Annotate | Download | only in ggrep
      1 #
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 #ident	"@(#)Makefile.sfw	1.12	09/09/22 SMI"
     26 
     27 include ../Makefile.cmd
     28 
     29 VER=$(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
     30 SOURCE_ARCHIVE = $(COMPONENT_ARCHIVE:sh)
     31 
     32 CFLAGS += -features=extensions
     33 
     34 PROGS=egrep fgrep grep
     35 MAN1FILES=$(PROGS:%=%.1)
     36 BINLINKS=$(PROGS:%=$(ROOTGNUBIN)/%)
     37 SFWLINKS=$(PROGS:%=$(ROOTSFWBIN)/g%)
     38 MAN1LINKS=$(MAN1FILES:%=$(ROOTGNUMAN1)/%)
     39 
     40 all: $(VER)/.built
     41 
     42 install: $(VER)/.installed $(BINLINKS) $(SFWLINKS) $(MAN1LINKS)
     43 	$(SRC)/tools/protofix --pkg $(COMPONENT_PACKAGES:sh) --perm 
     44 
     45 $(BINLINKS):
     46 	$(RM) $@ ; $(SYMLINK) ../../bin/g$(@F) $@
     47 
     48 $(SFWLINKS):
     49 	$(RM) $@ ; $(SYMLINK) ../../bin/$(@F) $@
     50 
     51 $(MAN1LINKS):
     52 	$(RM) $@ ; $(SYMLINK) ../../../../share/man/man1/ggrep.1 $@
     53 
     54 $(VER)/.built: $(VER)/config.status
     55 	(cd $(VER); env \
     56 	    CC=$(CC) \
     57 	    "CFLAGS=$(CFLAGS)" \
     58 	    LD_OPTIONS="-M $(SRC)/cmd/mapfile_noexstk" \
     59 	    PATH=$(SFW_PATH) \
     60 	    MAKE=$(GMAKE) \
     61 	    $(GMAKE))
     62 	@find . -name core -exec rm -f {} \;
     63 	$(TOUCH) $@
     64 
     65 $(VER)/.installed: $(VER)/.built
     66 	(cd $(VER); env - \
     67 		PATH=$(SFW_PATH) \
     68 		MANSCRIPT=$(COMPONENT_TOP)/sunman-stability \
     69 		DESTDIR=$(ROOT) \
     70 		MAKE=$(GMAKE) \
     71 		$(GMAKE) top_builddir=$(COMPONENT_TOP)/$(VER) install)
     72 	$(TOUCH) $@
     73 
     74 $(VER)/config.status: $(VER)/configure
     75 	(cd $(VER); env \
     76 	    CC=$(CC) \
     77 	    CFLAGS="$(CFLAGS)" \
     78 	    PATH=$(SFW_PATH) \
     79 	    INSTALL=$(INSTALL_PROTO) \
     80 	    MAKE=$(GMAKE) \
     81 	    $(CONFIG_SHELL) ./configure --prefix=/usr --program-prefix=g)
     82 
     83 $(VER)/configure: $(VER)/.patched
     84 	$(TOUCH) $@
     85 
     86 clean:
     87 	-rm -rf $(VER)
     88 
     89 include ../Makefile.targ
     90