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 2015 Joyent, Inc.
  23 #
  24 
  25 PROG =          lxinit
  26 
  27 PROG_OBJS =     lxinit.o pipe_stream.o run_command.o
  28 LIST_OBJS =     list.o
  29 
  30 OBJS =          $(PROG_OBJS) \
  31                 $(LIST_OBJS)
  32 SRCS =          $(PROG_OBJS:%.o=%.c) \
  33                 $(LIST_OBJS:%.o=$(SRC)/common/list/%.c)
  34 
  35 all:            $(PROG)
  36 
  37 include ../Makefile.lx
  38 include $(SRC)/cmd/Makefile.cmd
  39 
  40 # override the install directory
  41 ROOTBIN =       $(ROOTBRANDDIR)
  42 CLOBBERFILES =  $(OBJS) $(ROOTPROG)
  43 
  44 UTSBASE =       $(SRC)/uts
  45 
  46 CFLAGS +=       $(CCVERBOSE)
  47 CPPFLAGS +=     -D_REENTRANT -I$(UTSBASE)/common/brand/lx
  48 LDLIBS +=       -lzonecfg -lipadm -lsocket -linetutil -lnsl -lcmdutils -ldhcpagent
  49 
  50 .KEEP_STATE:
  51 
  52 install: all $(ROOTPROG)
  53 
  54 clean:
  55         $(RM) $(PROG) $(OBJS)
  56 
  57 lint: lint_PROG lint_SRCS
  58 
  59 $(PROG): $(OBJS)
  60         $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
  61         $(POST_PROCESS)
  62 
  63 %.o: %.c
  64         $(COMPILE.c) $<
  65         $(POST_PROCESS_O)
  66 
  67 %.o: $(SRC)/common/list/%.c
  68         $(COMPILE.c) $<
  69         $(POST_PROCESS_O)
  70 
  71 include $(SRC)/cmd/Makefile.targ