Home | History | Annotate | Download | only in iscsiadm
      1 #
      2 # CDDL HEADER START
      3 #
      4 # The contents of this file are subject to the terms of the
      5 # Common Development and Distribution License (the "License").
      6 # You may not use this file except in compliance with the License.
      7 #
      8 # You can obtain a copy of the license at src/sun_nws/OPENSOLARIS.LICENSE
      9 # or http://www.opensolaris.org/os/licensing.
     10 # See the License for the specific language governing permissions
     11 # and limitations under the License.
     12 #
     13 # When distributing Covered Code, include this CDDL HEADER in each
     14 # file and include the License file at src/sun_nws/OPENSOLARIS.LICENSE.
     15 # If applicable, add the following below this CDDL HEADER, with the
     16 # fields enclosed by brackets "[]" replaced with your own identifying
     17 # information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 # CDDL HEADER END
     20 #
     21 #
     22 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 #ident	"@(#)Makefile	1.7	08/06/25 SMI"
     26 #
     27 # src/sun_nws/iscsiadm/Makefile
     28 #
     29 
     30 include ../Makefile.config
     31 include ../Makefile.cmds
     32 
     33 BUILD64	= $(POUND_SIGN)
     34 
     35 MODULE  	 = iscsiadm
     36 
     37 STAGING32	 = $(PROTO_ROOT)/usr/sbin
     38 STAGING64	 =
     39 
     40 CPPFLAGS32	+= $(DTEXTDOM)
     41 CFLAGS32        += -DSOLARIS
     42 CFLAGS64        += -DSOLARIS
     43 
     44 MODULE_PKGS	 = SUNWiscsiu
     45 PROJ_DEPENDS 	 = ima
     46 
     47 MODULE_SRC	 = sun_ima.c iscsiadm.c cmdparse.c
     48 
     49 MODULE_OBJ_32    = $(MODULE_SRC:%.c=$(OBJ32)/%.o)
     50 MODULE_OBJ_32	+= $(COMMON_SRC:$(COM_SRC_ISCSI)/%.c=$(OBJ32)/%.o)
     51 MODULE_OBJ_64    =
     52 
     53 BINARY32         = $(OBJ32)/$(MODULE)
     54 BINARY64         =
     55 BINARIES         = $(BINARY32) $(BINARY64)
     56 
     57 COMMON_INCLUDES	+= -I$(COM_INC_ISCSI)
     58 COMMON_INCLUDES += -I$(COMMON_ISCSI_IMPL_HDRS_DIR)
     59 COMMON_INCLUDES += -I$(COMMON_IMA_IMPL_HDRS_DIR)
     60 
     61 sparc_INCLUDES	 =
     62 i386_INCLUDES	 =
     63 
     64 LDLIBS	 	 = -lnsl
     65 LDLIBS	 	+= -lsocket
     66 LDLIBS	 	+= -ldevinfo
     67 LDLIBS	 	+= -lima
     68 
     69 LDLIBS32	 = -L$(ON_LIB_32)
     70 LDLIBS32	+= -L$(ON_USRLIB_32)
     71 LDLIBS32	+= -L$(LIBIMA_32)
     72 LDLIBS32	+= $(LDLIBS)
     73 
     74 LDLIBS64	 =
     75 
     76 LINT_TARGETS	 = cmd_lint32
     77 LFLAGS32        += -DSOLARIS
     78 LFLAGS64        += -DSOLARIS
     79 
     80 # Handle creating our directories when needed
     81 DIRS += $(LCMESSAGES)
     82 
     83 ALLPREQ 	 = $(PROJ_DEPENDS)
     84 ALLPREQ 	+= $(OBJ32)
     85 ALLPREQ 	+= .WAIT
     86 ALLPREQ 	+= $(BINARIES)
     87 
     88 INSTALLPREQ	 = all
     89 INSTALLPREQ	+= .WAIT
     90 INSTALLPREQ	+= $(STAGING32)
     91 INSTALLPREQ	+= $(LCMESSAGES)
     92 INSTALLPREQ	+= .WAIT
     93 INSTALLPREQ	+= $(STAGING32)/$(MODULE)
     94 INSTALLPREQ	+= _msg
     95 
     96 PKGPREQ		 = install
     97 PKGPREQ         += $(PKGAREA)
     98 PKGPREQ		+= .WAIT
     99 PKGPREQ         += $(MODULE_PKGS:%=$(PKGAREA)/%)
    100 
    101 CLEANFILES       = $(MODULE_OBJ_32)
    102 CLEANFILES      += $(BINARY32)
    103 
    104 CLOBBERFILES     = $(CLEANFILES)
    105 CLOBBERFILES    += $(MOD_LINT_LIB)
    106 CLOBBERFILES    += $(POFILE)
    107 
    108 NUKEFILES        = $(CLOBBERFILES)
    109 NUKEFILES       += $(STAGING32)/$(MODULE)
    110 NUKEFILES       += $(MODULE_PKGS:%=$(PKGAREA)/%)
    111 
    112 # definitions for i18n
    113 POFILE= 	$(LIBRARY:%.a=%.po)
    114 MSGFILES=	`$(GREP) -l gettext src/*.[ch]`
    115 
    116 include ../Makefile.common
    117 #
    118 # For source message catalogue
    119 #
    120 .SUFFIXES: $(SUFFIXES) .po
    121 MSGROOT= $(PROTO_ROOT)/catalog
    122 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
    123 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
    124 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
    125 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
    126 
    127 XGETFLAGS= -c TRANSLATION_NOTE -p $(OBJ32)
    128 
    129 TEXT_DOMAIN= SUNW_OST_OSLIB
    130 POFILE= iscsiadm.po
    131 POFILES= $(MODULE_SRC:%=src/%)
    132 
    133 .PARALLEL:	$(POFILES) $(MSGFILES)
    134 
    135 $(MSGDOMAIN) $(DCMSGDOMAIN):
    136 	$(INS.dir)
    137 
    138 $(DCMSGDOMAINPOFILE): $(DCMSGDOMAIN) $(DCFILE)
    139 	$(RM) $@; $(CP) $(DCFILE) $@
    140 
    141 BUILDPO.msgfiles = \
    142 	$(RM) $(OBJ32)/messages.po $(OBJ32)/$(TEXT_DOMAIN).po; \
    143 	$(TOUCH) $(OBJ32)/$(TEXT_DOMAIN).po; \
    144 	$(XGETTEXT) $(XGETFLAGS) $(MSGFILES); \
    145 	$(SED) -e '/^\# msgid/,/^\# msgstr/d' -e '/^domain/d' \
    146 		$(OBJ32)/messages.po $(OBJ32)/$(TEXT_DOMAIN).po > $(OBJ32)/$(POFILE); \
    147 	$(RM) $(OBJ32)/messages.po $(OBJ32)/$(TEXT_DOMAIN).po
    148 
    149 pofile_MSGFILES:
    150 	$(BUILDPO.msgfiles)
    151 
    152 _msg: pofile_MSGFILES
    153 
    154