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 2006 Sun Microsystems, Inc. All rights reserved. 23 # Use is subject to license terms. 24 # 25 # Copyright (c) 2018, Joyent, Inc. 26 27 LIBRARY= libtnfctl.a 28 VERS= .1 29 OBJECTS.c= open.o \ 30 prb_child.o \ 31 prb_shmem.o \ 32 prb_proc.o \ 33 prb_lmap.o \ 34 prb_rtld.o \ 35 prb_findexec.o \ 36 prb_status.o \ 37 util.o \ 38 traverse.o \ 39 sym.o \ 40 elf.o \ 41 continue.o \ 42 checklib.o \ 43 probes.o \ 44 probes_ext.o \ 45 close.o \ 46 targmem.o \ 47 comb.o \ 48 kernel_int.o \ 49 kernel.o \ 50 internal.o \ 51 status.o 52 53 54 OBJECTS.s= $(MACH)_assm.o 55 56 OBJECTS= $(OBJECTS.c) $(OBJECTS.s) 57 58 include ../../Makefile.lib 59 60 # We omit $(OBJECTS.s:%.o=%.s) in the next line, because lint no like 61 SRCS= $(OBJECTS.c:%.o=../%.c) 62 63 LIBS= $(DYNLIB) 64 65 HDRS= tnfctl.h 66 ROOTHDRDIR= $(ROOT)/usr/include/tnf 67 ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) 68 CHECKHDRS= $(HDRS:%.h=%.check) 69 $(ROOTHDRS) := FILEMODE = 0644 70 CHECKHDRS = $(HDRS:%.h=%.check) 71 72 LDLIBS += -lc -lelf 73 74 # Uncomment the following line for a debug build 75 # COPTFLAG = -g -DDEBUG $(CCVERBOSE) 76 CPPFLAGS += -I$(SRC)/lib/libtnfprobe -D_REENTRANT -I$(SRC)/cmd/sgs/include 77 78 LINTFLAGS += -y 79 80 CERRWARN += -_gcc=-Wno-uninitialized 81 CERRWARN += -_gcc=-Wno-empty-body 82 CERRWARN += -_gcc=-Wno-parentheses 83 84 # not linted 85 SMATCH=off 86 87 ASFLAGS += -P 88 89 $(ROOTHDRS) := FILEMODE = 644 90 91 .KEEP_STATE: 92 93 all: $(LIBS) 94 95 install_h: $(ROOTHDRDIR) $(ROOTHDRS) 96 97 lint: 98 $(LINT.c) $(SRCS) 99 100 check: $(CHECKHDRS) 101 102 $(ROOTLIBDIR) $(ROOTHDRDIR): 103 $(INS.dir) 104 105 $(ROOTHDRDIR)/% : % 106 $(INS.file) 107 108 BUILD.s= $(AS) $< -o $@ 109 110 objs/%.o pics/%.o: ../%.s 111 $(COMPILE.s) -o $@ $< 112 $(POST_PROCESS_O) 113 114 objs/%.o pics/%.o: ../%.c 115 $(COMPILE.c) -o $@ $< 116 $(POST_PROCESS_O) 117 118 119 %.o: ../%.c 120 $(COMPILE.c) -o $@ $< 121 $(POST_PROCESS_O) 122 123 include ../../Makefile.targ