17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5*f808c858Sraf# Common Development and Distribution License (the "License"). 6*f808c858Sraf# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# 22*f808c858Sraf# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 267c478bd9Sstevel@tonic-gate# 27*f808c858Sraf 287c478bd9Sstevel@tonic-gateLIBRARY= libdump.a 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate# Has to be before include of Makefile.backup 317c478bd9Sstevel@tonic-gate# This should be POFILE=libdump.po, but that causes make to 327c478bd9Sstevel@tonic-gate# fall over due to some seriously weird interactions in the 337c478bd9Sstevel@tonic-gate# various indirectly-included makefiles. So, since this works 347c478bd9Sstevel@tonic-gate# and is otherwise harmless, we fake it. 357c478bd9Sstevel@tonic-gatePROG= libdump 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate# Include library definitions, then backup definitions, as in general 387c478bd9Sstevel@tonic-gate# we want the flags and such from our tree. 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gateinclude ../../../lib/Makefile.lib 417c478bd9Sstevel@tonic-gateinclude ../Makefile.backup 427c478bd9Sstevel@tonic-gate 43*f808c858SrafSRCDIR = . 44*f808c858Sraf 457c478bd9Sstevel@tonic-gate# Specifically request the construction of a static library. 467c478bd9Sstevel@tonic-gate# This library is not installed in the proto area. 477c478bd9Sstevel@tonic-gateLIBS= $(LIBRARY) 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gateHDRS= ../include/byteorder.h \ 507c478bd9Sstevel@tonic-gate ../include/memutils.h ../include/myrcmd.h \ 517c478bd9Sstevel@tonic-gate ../../../head/protocols/dumprestore.h \ 527c478bd9Sstevel@tonic-gate ../include/rmt.h 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gateYFILE= getdate.y 557c478bd9Sstevel@tonic-gateYSRC= getdate.c 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gateCLOBBERFILES= $(YSRC) $(GLIB) *.ln 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gateLOBJS= rmtlib.o myrcmd.o \ 607c478bd9Sstevel@tonic-gate $(YSRC:%.c=%.o) \ 617c478bd9Sstevel@tonic-gate byteorder.o memutils.o $(RPC_CLNT:%.c=%.o) $(RPC_XDR:%.c=%.o) 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gateOBJECTS= $(LOBJS) 647c478bd9Sstevel@tonic-gatePOFILES= $(OBJECTS:.o=.po) 657c478bd9Sstevel@tonic-gateGENERAL= ../include 667c478bd9Sstevel@tonic-gateGLOBAL= ../../../head 677c478bd9Sstevel@tonic-gateCPPFLAGS= -I$(GENERAL) -I$(GLOBAL) $(CPPFLAGS.master) 687c478bd9Sstevel@tonic-gateLINTOUT= lint.out 697c478bd9Sstevel@tonic-gateCLEANFILES= $(OBJECTS) $(LINTOUT) $(LINTLIB) $(DEBUGS) *.ln \ 707c478bd9Sstevel@tonic-gate $(YSRC) $(LIBRARY) 717c478bd9Sstevel@tonic-gateLINTFLAGS += -y 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate# support for -g library 747c478bd9Sstevel@tonic-gateGLIB= libdump_g.a 757c478bd9Sstevel@tonic-gateDEBUGS= $(OBJECTS:%=.debug/%) 767c478bd9Sstevel@tonic-gate$(GLIB):= AROBJS = $(DEBUGS) 777c478bd9Sstevel@tonic-gate$(GLIB):= DIR = .debug 787c478bd9Sstevel@tonic-gate$(GLIB):= CFLAGS= -g $(XESS) -DDEBUG -DYYDEBUG ${SBFLAGS} 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate.KEEP_STATE: 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gateall: $(LIBS) 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gatedebug: $(LIBS) $(GLIB) 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate.debug: 877c478bd9Sstevel@tonic-gate -@mkdir -p $@ 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate.debug/%.o: %.c 907c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 917c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate$(GLIB): .debug $$(DEBUGS) 947c478bd9Sstevel@tonic-gate $(BUILD.AR) 957c478bd9Sstevel@tonic-gate $(POST_PROCESS_A) 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate$(OBJECTS): $(HDRS) 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gateinstall: all 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) 1027c478bd9Sstevel@tonic-gate $(RM) $@; cat $(POFILES) > $@ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate# rpcgen produces unused local variables that we can't easily suppress. 1057c478bd9Sstevel@tonic-gate# It is also stupid about 32/64 bit integers. Since we don't support 1067c478bd9Sstevel@tonic-gate# the RPC subsystem any more, just ignore complaints about it all. 1077c478bd9Sstevel@tonic-gate# We have no control over yaccpar, and it has lots of 32/64 complaints. 1087c478bd9Sstevel@tonic-gate# Assumes lint run with -s argument 1097c478bd9Sstevel@tonic-gatelint: lint.out 1107c478bd9Sstevel@tonic-gate sed -f lint.sed lint.out 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gatelint.out: $(LINTLIB) 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gatecheck: $(HDRS) 1157c478bd9Sstevel@tonic-gate $(CSTYLE) $(CSTYLEFLAGS) `echo $(SRCS) | sed -e s/getdate.c//` $(HDRS) 1167c478bd9Sstevel@tonic-gate $(HDRCHK) $(HDRCHKFLAGS) $(HDRS) 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate# include library targets 1197c478bd9Sstevel@tonic-gateinclude ../../../lib/Makefile.targ 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate_msg: $(POFILE) 122