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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 23 # Copyright 2012 Milan Jurik. All rights reserved. 24 # Copyright 2016 Toomas Soome <tsoome@me.com> 25 # Copyright (c) 2018, Joyent, Inc. 26 # 27 28 PROG = svc.startd 29 OBJS = \ 30 contract.o \ 31 deathrow.o \ 32 dict.o \ 33 env.o \ 34 expand.o \ 35 file.o \ 36 fork.o \ 37 graph.o \ 38 libscf.o \ 39 log.o \ 40 method.o \ 41 misc.o \ 42 protocol.o \ 43 restarter.o \ 44 specials.o \ 45 startd.o \ 46 transition.o \ 47 wait.o \ 48 utmpx.o 49 50 ALLOBJS = $(OBJS) \ 51 proc.o \ 52 manifest_hash.o 53 54 SRCS = $(OBJS:%.o=%.c) \ 55 proc.c \ 56 ../common/manifest_hash.c 57 58 POFILES = $(OBJS:%.o=%.po) \ 59 proc.po \ 60 ../common/manifest_hash.po 61 62 include ../../Makefile.cmd 63 include ../../Makefile.ctf 64 65 ROOTCMDDIR= $(ROOT)/lib/svc/bin 66 67 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG 68 CFLAGS += $(CCVERBOSE) 69 CPPFLAGS += -I. -I../common 70 71 CERRWARN += -_gcc=-Wno-parentheses 72 CERRWARN += -_gcc=-Wno-unused-label 73 CERRWARN += -_gcc=-Wno-switch 74 CERRWARN += -_gcc=-Wno-uninitialized 75 76 # these look like real bugs here, but ... 77 SMOFF += impossible_mask,signed_integer_overflow_check 78 79 $(OBJS) := CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT 80 81 proc.o := CPPFLAGS += -D_REENTRANT 82 83 %.o: ../common/%.c 84 $(COMPILE.c) $(OUTPUT_OPTION) $< 85 $(POST_PROCESS_O) 86 87 %.ln: ../common/%.c 88 $(LINT.c) $(OUTPUT_OPTION) -c $< 89 90 LDLIBS += \ 91 -lcontract \ 92 -lkstat \ 93 -lmd5 \ 94 -lnvpair \ 95 -lrestart \ 96 -lscf \ 97 -lsysevent \ 98 -lumem \ 99 -luutil 100 101 LDLIBS_i386 += -lbe 102 LDLIBS += $(LDLIBS_$(MACH)) -L $(ROOT)/lib/fm -lfmevent 103 LDFLAGS += -R /lib/fm 104 105 FILEMODE = 0555 106 107 # lint doesn't like the unused _umem_*_init() 108 # And lint thinks uadmin() is undefined. 109 lint_SRCS := LINTFLAGS += -U_FILE_OFFSET_BITS -xerroff=E_NAME_DEF_NOT_USED2 -u 110 lint_SRCS := CPPFLAGS += \ 111 -I. -I../common -D_REENTRANT -D_FILE_OFFSET_BITS=64 112 113 .KEEP_STATE: 114 115 .PARALLEL: $(ALLOBJS) 116 117 all: $(PROG) 118 119 $(PROG): $(ALLOBJS) 120 $(LINK.c) -o $@ $(ALLOBJS) $(LDLIBS) $(LDFLAGS) $(CTFMERGE_HOOK) 121 $(POST_PROCESS) 122 123 $(POFILE): $(POFILES) 124 cat $(POFILES) > $(POFILE) 125 126 install: all $(ROOTCMD) 127 128 clean: 129 $(RM) $(ALLOBJS) 130 131 lint: lint_SRCS 132 133 include ../../Makefile.targ