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) 2008-2009, Intel Corporation. 23 # All Rights Reserved. 24 # 25 # Copyright 2017 RackTop Systems. 26 # 27 28 PROG = latencytop 29 OBJS = latencytop.o display.o dwrapper.o klog.o stat.o table.o util.o 30 SRCS = $(OBJS:%.o=../common/%.c) 31 32 include ../../Makefile.cmd 33 34 CFLAGS += $(CCVERBOSE) 35 CFLAGS64 += $(CCVERBOSE) 36 37 CERRWARN += -_gcc=-Wno-uninitialized 38 39 CPPFLAGS += -DEMBED_CONFIGS -I$(ADJUNCT_PROTO)/usr/include/glib-2.0 \ 40 -I$(ADJUNCT_PROTO)/usr/lib/glib-2.0/include 41 C99MODE = $(C99_ENABLE) 42 LDLIBS += -lcurses -ldtrace 43 all install := LDLIBS += -lglib-2.0 44 45 # Allow libglib to be taken from outside the proto area. 46 $(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so 47 48 LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 49 LINTFLAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 50 LINTFLAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2 51 LINTFLAGS64 += -erroff=E_NAME_USED_NOT_DEF2 52 LINTFLAGS64 += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 53 LINTFLAGS64 += -erroff=E_FUNC_RET_MAYBE_IGNORED2 54 55 FILEMODE = 0555 56 57 ELFWRAP = elfwrap 58 WRAPOBJ = latencytop_wrap.o 59 60 CLEANFILES += $(OBJS) $(WRAPOBJ) ./latencytop_d ./latencytop_trans 61 62 .KEEP_STATE: 63 64 all: $(PROG) 65 66 install: $(SUBDIRS) 67 -$(RM) $(ROOTPROG) 68 -$(LN) $(ISAEXEC) $(ROOTPROG) 69 70 $(PROG): $(OBJS) $(WRAPOBJ) 71 $(LINK.c) -o $@ $(OBJS) $(WRAPOBJ) $(LDLIBS) 72 $(POST_PROCESS) 73 74 $(WRAPOBJ): latencytop_d latencytop_trans 75 $(ELFWRAP) $(WRAPOPT) -o $(WRAPOBJ) latencytop_d latencytop_trans 76 77 latencytop_d: 78 cp ../common/latencytop.d ./latencytop_d 79 80 latencytop_trans: 81 cp ../common/latencytop.trans ./latencytop_trans 82 83 clean: 84 $(RM) $(CLEANFILES) 85 86 lint: lint_SRCS 87 88 %.o: ../common/%.c 89 $(COMPILE.c) $< 90 91 include ../../Makefile.targ