usr/src/cmd/rad/Makefile
author David Powell <David.Powell@sun.com>
Tue, 15 Dec 2009 18:07:22 -0800
changeset 395 dceab4d00ec5
parent 393 e94f0dfff865
child 436 c28d8d667ea1
permissions -rw-r--r--
13386 various build issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
391
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     1
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     2
# CDDL HEADER START
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     3
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     7
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    11
# and limitations under the License.
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    12
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    18
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    19
# CDDL HEADER END
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    20
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    21
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    22
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    23
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    24
# Use is subject to license terms.
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    25
#
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    26
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    27
include $(SRC)/Makefile.env
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    28
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    29
PROTO_RAD=$(PROTO_LIB)/rad
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    30
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    31
ADRLOC=../../java/adr/adr.jar
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    32
ADRGEN=java -classpath $(ADRLOC) org.opensolaris.os.adr.adrgen.ADRGen
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    33
APIS=../../apis
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    34
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    35
CPPFLAGS = -I/usr/include/libxml2
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    36
CFLAGS = -g -mt -errwarn=%all
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    37
RAD_LDFLAGS=-lsocket -lnsl -lumem -lsecdb -lpam -lbsm -lxml2 -lscf
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    38
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    39
RAD = rad
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    40
ADR_OBJS = \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    41
	api_errors_impl.o\
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    42
	api_modules_impl.o\
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    43
	api_pam_impl.o\
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    44
	api_config_impl.o\
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    45
	api_radcontrol_impl.o
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    46
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    47
OBJS = \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    48
	$(ADR_OBJS) \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    49
	list.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    50
	rad_adr.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    51
	rad_connection.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    52
	rad_control.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    53
	rad_defaults.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    54
	rad_log.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    55
	rad_meta.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    56
	rad_module.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    57
	rad_object.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    58
	rad_pam.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    59
	rad_proto.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    60
	rad_slave.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    61
	rad_smf.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    62
	rad_subject.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    63
	rad_ticket.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    64
	rad_util.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    65
	rad_xdr.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    66
	rad_xport.o \
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    67
	rad.o
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    68
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    69
ADR_APIS=$(ADR_OBJS:api_%_impl.o=%)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    70
ADR_SRCS=$(ADR_APIS:%=api_%_impl.c) $(ADR_APIS:%=api_%.h)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    71
CLEAN_FILES = $(OBJS) $(ADR_SRCS)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    72
CLOBBER_FILES = $(CLEAN_FILES) $(RAD)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    73
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    74
.KEEP_STATE:
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    75
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    76
all:	$(RAD)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    77
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    78
rad.o:		api_config.h
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    79
rad_object.o:	api_errors.h
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    80
rad_module.o:	api_modules.h
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    81
rad_pam.o:	api_pam.h
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    82
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    83
$(RAD):	$(OBJS)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    84
	cc -o rad $(OBJS) $(RAD_LDFLAGS)
395
dceab4d00ec5 13386 various build issues
David Powell <David.Powell@sun.com>
parents: 393
diff changeset
    85
	$(CTFMERGE) -l foo -o $(RAD) $(OBJS)
391
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    86
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    87
install: $(PROTO_LIB)/rad/rad $(PROTO_MFS_SYSTEM)/rad.xml
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    88
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    89
$(ADR_SRCS): $(ADRLOC)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    90
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    91
api_%.h api_%_impl.c: $(SRC)/apis/%.xml
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    92
	$(ADRGEN) -c $<
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    93
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    94
api_%.h api_%_impl.c: %.xml
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    95
	$(ADRGEN) -c $<
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    96
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    97
FILEMODE=0555
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    98
$(PROTO_RAD)/%: %
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
    99
	$(INS.file)
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
   100
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
   101
.c.o:
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
   102
	$(COMPILE.c) $(OUTPUT_OPTIONS) -c $<
395
dceab4d00ec5 13386 various build issues
David Powell <David.Powell@sun.com>
parents: 393
diff changeset
   103
	$(CTFCONVERT) -l foo $@
391
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
   104
71abce159a62 13357 rad
David Powell <David.Powell@sun.com>
parents:
diff changeset
   105
include $(SRC)/Makefile.targ