xref: /illumos-gate/usr/src/cmd/idmap/idmapd/Makefile (revision 6d1d45ee7157107ef92303ea769d6d3fcf5dfcc8)
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 usr/src/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 usr/src/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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28PROG =		idmapd
29MANIFEST =	idmap.xml
30SERVEROBJS =	idmapd.o init.o dbutils.o rpc_svc.o server.o adutils.o addisc.o\
31	idmap_config.o nldaputils.o
32SERVERSRCS =	$(SERVEROBJS:%.o=%.c)
33OBJS =		$(SERVEROBJS)
34SRCS =		$(SERVERSRCS)
35POFILES =	$(OBJS:%.o=%.po)
36
37all :=		TARGET = all
38install :=	TARGET = install
39clean :=	TARGET = clean
40clobber :=	TARGET = clobber
41
42LIBSQLITE =	$(ROOT)/usr/lib/libsqlite.o
43SQLITELINT =	$(ROOT)/usr/lib/llib-lsqlite.ln
44
45IDMAP_PROT_DIR =        $(SRC)/head/rpcsvc
46IDMAP_PROT_X =          $(IDMAP_PROT_DIR)/idmap_prot.x
47IDMAP_PROT_H =          $(IDMAP_PROT_DIR)/idmap_prot.h
48
49include ../../Makefile.cmd
50
51POFILE =	$(PROG)_all.po
52
53ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
54$(ROOTMANIFEST) := FILEMODE= 444
55
56INCS += -I. -I../../../lib/libidmap/common -I$(IDMAP_PROT_DIR)
57
58$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
59$(POFILE) := CPPFLAGS += $(INCS)
60CLOBBERFILES += $(IDMAP_PROT_H)
61
62CFLAGS += -v
63LDLIBS += -lsecdb -lresolv -lsocket -lnsl -lidmap -lscf -lldap -luuid
64
65$(PROG) := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
66$(PROG) := LDFLAGS += $(MAPFILES:%=-M%)
67
68DIRMODE = 0755
69FILEMODE = 0555
70OWNER = root
71GROUP = sys
72
73lint_SRCS := CPPFLAGS += $(INCS) -D_REENTRANT
74lint := LDLIBS += $(SQLITELINT)
75
76LINTFLAGS += -erroff=E_CONSTANT_CONDITION
77
78.KEEP_STATE:
79
80.PARALLEL: $(OBJS)
81
82all: $(PROG)
83
84$(IDMAP_PROT_H):	$(IDMAP_PROT_X)
85	$(RM) $@; $(RPCGEN) -CMNh -o $@ $(IDMAP_PROT_X)
86
87$(PROG): $(IDMAP_PROT_H) $(OBJS) $$(MAPFILES)
88	$(LINK.c) -o $@ $(OBJS) $(LIBSQLITE) $(LDLIBS)
89	$(POST_PROCESS)
90
91$(POFILE): $(POFILES)
92	$(RM) $(POFILE)
93	cat $(POFILES) > $(POFILE)
94
95install: all $(ROOTLIBPROG) $(ROOTMANIFEST)
96
97check: $(CHKMANIFEST)
98
99clean:
100	$(RM) $(OBJS)
101
102clobber:
103
104lint:   lint_SRCS
105
106lint_SRCS:
107
108include ../../Makefile.targ
109
110FRC:
111
112