17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate# Use is subject to license terms.
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
67c478bd9Sstevel@tonic-gate#
77c478bd9Sstevel@tonic-gateinclude ../../Makefile.grub
87c478bd9Sstevel@tonic-gateinclude ../Makefile.solaris.defs
97c478bd9Sstevel@tonic-gate
107c478bd9Sstevel@tonic-gateINCLUDES	= -I. -I.. -I../stage1 -I../stage2
117c478bd9Sstevel@tonic-gateCFLAGS		+= -O2
127c478bd9Sstevel@tonic-gate
137c478bd9Sstevel@tonic-gate
147c478bd9Sstevel@tonic-gateLIBCOMMON	= libcommon.a
157c478bd9Sstevel@tonic-gateLIBCOMMON_OBJS	= device.o \
167c478bd9Sstevel@tonic-gate		  getopt.o \
177c478bd9Sstevel@tonic-gate		  getopt1.o
187c478bd9Sstevel@tonic-gate
197c478bd9Sstevel@tonic-gateLIBRARIES	= $(LIBCOMMON)
207c478bd9Sstevel@tonic-gate
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate# Source files to be installed in $(SRC_DIR).
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gateSRC_DIR		= $(ROOT_SRC)/lib
257c478bd9Sstevel@tonic-gateSRC_FILES	= Makefile.am Makefile.in device.c device.h \
267c478bd9Sstevel@tonic-gate		  getopt.c getopt.h getopt1.c
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateINSTALL_TARGETS	= $(SRC_FILES:%=$(SRC_DIR)/%)
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateall: $(LIBRARIES)
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gate$(LIBCOMMON): $(LIBCOMMON_OBJS)
347c478bd9Sstevel@tonic-gate	$(RM) $@
357c478bd9Sstevel@tonic-gate	$(AR) cru $@ $(LIBCOMMON_OBJS)
367c478bd9Sstevel@tonic-gate	$(RANLIB) $@
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gate$(LIBCOMMON_OBJS): $$(@:.o=.c)
397c478bd9Sstevel@tonic-gate	$(CC) $(CFLAGS) -c -o $@ $(@:.o=.c)
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateinstall: all $(INSTALL_TARGETS)
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate$(SRC_DIR)/%: $(SRC_DIR) %
457c478bd9Sstevel@tonic-gate	$(INS.file)
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gate$(SRC_DIR):
487c478bd9Sstevel@tonic-gate	$(INS.dir)
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateclean: _FORCE
527c478bd9Sstevel@tonic-gate	$(RM) *.o $(LIBRARIES)
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gateclobber: clean
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate_FORCE:
57