Makefile revision 7c478bd95313f5f23a4c958a745db2134aa03244
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson#
cfa2326b5c96a3a4c720262e077b2baf9fc27970Tinderbox User# CDDL HEADER START
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington#
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# The contents of this file are subject to the terms of the
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# Common Development and Distribution License, Version 1.0 only
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# (the "License"). You may not use this file except in compliance
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# with the License.
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# or http://www.opensolaris.org/os/licensing.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# See the License for the specific language governing permissions
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# If applicable, add the following below this CDDL HEADER, with the
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# fields enclosed by brackets "[]" replaced with your own identifying
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson#
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# CDDL HEADER END
2c089bf6d24936de631a57b4958ba6b8b5e3b23dMark Andrews#
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson#
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson# Use is subject to license terms.
2c089bf6d24936de631a57b4958ba6b8b5e3b23dMark Andrews#
2c089bf6d24936de631a57b4958ba6b8b5e3b23dMark Andrews# ident "%Z%%M% %I% %E% SMI"
8351864ef814ef83148919d927ec9d7f66b78200Andreas Gustafsson#
# cmd/rpcsvc/nis/utils/Makefile
#
# Makefile for the nis_plus utility programs.
#
all:= TARGET= all
install:= TARGET= install
clean:= TARGET= clean
clobber:= TARGET= clobber
lint:= TARGET= lint
SUBDIRS= nisaddcred
# links to nischmod
LPROG= nischgrp nischown nischttl
PROG= niscat nismatch nistest nisdefaults nischmod nisrm \
nisgrep nismkdir nisrmdir nistbladm nisgrpadm nisln \
nisls niserror nispath nisprefadm
SRCS= niscat.c nismatch.c nistest.c nisdefaults.c nischmod.c nisrm.c \
nisgrep.c nismkdir.c nisrmdir.c nistbladm.c nisgrpadm.c nisln.c \
nisls.c niserror.c nispath.c nisprefadm.c
OBJS= niscat.o nismatch.o nistest.o nisdefaults.o nischmod.o nisrm.o \
nisgrep.o nismkdir.o nisrmdir.o nistbladm.o nisgrpadm.o nisln.o \
nisls.o niserror.o nispath.o nisprefadm.o
RPROG= nisaddent nisauthconf
RSRCS= nisaddent.c nisauthconf.c
ROBJS= nisaddent.o nisauthconf.o
UTILSRCS= nis_util.c
UTILOBJS= nis_util.o
BACKUP_PROG= nisbackup
BACKUP_SRCS= nisbackup.cc ../rpc.nisd/nis_log_common.c \
../rpc.nisd/nis_mt.c ../rpc.nisd/nis_cleanup.c
BACKUP_OBJS= nisbackup.o nis_log_common.o nis_mt.o nis_cleanup.o
RESTORE_PROG= nisrestore
RESTORE_SRCS= nisrestore.cc ../rpc.nisd/nis_log_common.c \
../rpc.nisd/nis_mt.c ../rpc.nisd/nis_cleanup.c
RESTORE_OBJS= nisrestore.o nis_log_common.o nis_mt.o nis_cleanup.o
BKRSTPROG= $(BACKUP_PROG) $(RESTORE_PROG)
# XX64 nisrestore and nisbackup require C++
__GNUC:sh= echo \\043
$(__GNUC)BKRSTPROG=
DERIVED_FILES= ../rpc.nisd/nis_svc.h
include ../../../Makefile.cmd
ROOTNSLIB= $(ROOT)/usr/lib/nis
ROOTUSRSBIN= $(ROOT)/usr/sbin
ROOTNSPROG= $(RPROG:%=$(ROOTNSLIB)/%)
ROOTLPROG= $(LPROG:%=$(ROOTBIN)/%)
ROOTUSBPROG= $(BKRSTPROG:%=$(ROOTUSRSBIN)/%)
CLOBBERFILES += $(RPROG) $(LPROG) $(BACKUP_PROG) $(RESTORE_PROG)\
$(DERIVED_FILES)
PROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
CPPFLAGS += -I$(SRC)/lib/libnsl/include -I$(SRC)/lib/libnisdb
LDLIBS += -lnsl util.a
nispasswd := LDLIBS = $(LDLIBS.cmd) -lnsl
LDLIBS += -lc
.KEEP_STATE:
all: $(DERIVED_FILES) util.a $(SUBDIRS) $(PROG) $(RPROG) $(LPROG) \
$(BKRSTPROG)
install: all $(SUBDIRS) $(ROOTPROG) $(ROOTNSPROG) $(ROOTLPROG) $(ROOTUSBPROG)
clean:
$(RM) $(OBJS) $(ROBJS) $(UTILOBJS) $(BACKUP_OBJS) $(RESTORE_OBJS) util.a
lint: lint_SRCS
nispasswd:
@$(ECHO) "\`\`nispasswd'' is now a link to \`\`passwd''."
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
#
# build an archive library so that those programs that need stuff can
# get it, but others won't link in unneeded routines.
#
util.a: $(UTILOBJS)
$(AR) -crv $@ $(UTILOBJS)
$(PROG:%=%): $$@.o util.a
$(LINK.c) -o $@ $@.o $(LDLIBS)
$(POST_PROCESS)
$(LPROG): nischmod
-$(RM) $@ ; $(LN) nischmod $@
$(ROOTLPROG): $(ROOTBIN)/nischmod
-$(RM) $@ ; $(LN) $(ROOTBIN)/nischmod $@
$(ROOTNSLIB):
$(INS.dir)
$(ROOTNSLIB)/%: % $(ROOTNSLIB)
$(INS.file)
$(RESTORE_PROG): $(DERIVED_FILES) $(RESTORE_OBJS) util.a
$(LINK.cc) -o $@ $(RESTORE_OBJS) $(LDLIBS) -lnisdb
$(POST_PROCESS)
$(BACKUP_PROG): $(DERIVED_FILES) $(BACKUP_OBJS) util.a
$(LINK.cc) -o $@ $(BACKUP_OBJS) $(LDLIBS) -lnisdb
$(POST_PROCESS)
nis_log_common.o: ../rpc.nisd/nis_log_common.c $(DERIVED_FILES)
$(COMPILE.c) ../rpc.nisd/nis_log_common.c
$(POST_PROCESS_O)
nis_mt.o: ../rpc.nisd/nis_mt.c $(DERIVED_FILES)
$(COMPILE.c) ../rpc.nisd/nis_mt.c
$(POST_PROCESS_O)
nis_cleanup.o: ../rpc.nisd/nis_cleanup.c $(DERIVED_FILES)
$(COMPILE.c) ../rpc.nisd/nis_cleanup.c
$(POST_PROCESS_O)
#
# Rules for building the derived files :
#
$(DERIVED_FILES): $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis.x |\
sed -n -e '/EDIT_START/,$$ p' |\
sed -e 's/_2_svc/_svc/' |\
sed -e 's/_3_svc/_svc/' |\
sed -e 's/_3/_clnt/' |\
sed -e 's/_2/_clnt/' >../rpc.nisd/nis_svc.h
include ../../../Makefile.targ
FRC: