1# 2# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 3# Use is subject to license terms. 4# 5# ident "%Z%%M% %I% %E% SMI" 6# 7include ../../Makefile.grub 8include ../Makefile.solaris.defs 9 10INCLUDES = -I. -I.. -I../stage1 -I../stage2 11CFLAGS += -O2 12 13 14LIBCOMMON = libcommon.a 15LIBCOMMON_OBJS = device.o \ 16 getopt.o \ 17 getopt1.o 18 19LIBRARIES = $(LIBCOMMON) 20 21# 22# Source files to be installed in $(SRC_DIR). 23# 24SRC_DIR = $(ROOT_SRC)/lib 25SRC_FILES = Makefile.am Makefile.in device.c device.h \ 26 getopt.c getopt.h getopt1.c 27 28INSTALL_TARGETS = $(SRC_FILES:%=$(SRC_DIR)/%) 29 30 31all: $(LIBRARIES) 32 33$(LIBCOMMON): $(LIBCOMMON_OBJS) 34 $(RM) $@ 35 $(AR) cru $@ $(LIBCOMMON_OBJS) 36 $(RANLIB) $@ 37 38$(LIBCOMMON_OBJS): $$(@:.o=.c) 39 $(CC) $(CFLAGS) -c -o $@ $(@:.o=.c) 40 41 42install: all $(INSTALL_TARGETS) 43 44$(SRC_DIR)/%: $(SRC_DIR) % 45 $(INS.file) 46 47$(SRC_DIR): 48 $(INS.dir) 49 50 51clean: _FORCE 52 $(RM) *.o $(LIBRARIES) 53 54clobber: clean 55 56_FORCE: 57