###############################################################################
#
#
#	Makefile for Common Product code
#
#	$(TOP)/inst/Makefile
#
#
#	Intended to do makes on common stuff shared between other
#	Product sections
#
#	This one does no compiles. It just moves common stuff into $(SHIP)
#
#	Directories below this directory are not walked and are:
#	$(TOP)/inst -
#			Contains installation scripts (instal, uninstal)
#			This is the repository for the makefile
#			(locally Make.ship) which is moved into the
#			ship dir for the actual make of the installp
#			formatted file (or device image). It is stored here so
#			that the entire ship directory can be destroyed and/or
#			frozen between releases without the other product sub-
#			parts knowing about it.
###############################################################################

DNAME = gm
LPP_FILESET1 = devices.pci.c1144380.rte

all: $(DNAME)_errids.h

###############################################################################
#	These are the macros to ship the code $(CLEAN_SHIP) is required
#	copy appropriate stuff to ship dir
#	Certain copies use cp because they are not in .al or .inventory
###############################################################################
ship: $(DNAME)_errids.h
	-@$(CLEAN_SHIP)
	@$(OPT_SHIP) $(LPP_FILESET1).odmadd
	@$(OPT_SHIP) $(LPP_FILESET1).unodmadd
	@$(OPT_SHIP) $(LPP_FILESET1).odmdel
	@$(OPT_SHIP) $(LPP_FILESET1).trc
	@$(OPT_SHIP) $(LPP_FILESET1).copyright
	@$(OPT_SHIP) $(LPP_FILESET1).err
	@$(OPT_SHIP) productid
	@cp lpp_name $(SHIP)/lpp_name
	@cp lpp_name.$(LPP_FILESET1) $(SHIP)/lpp_name.$(LPP_FILESET1)
	@cp Make.ship $(SHIP)/Makefile


trace:
	(cp $(LPP_FILESET1).trc /etc;\
	cd /etc;\
	if [ -f $(LPP_FILESET1).undo.trc ]; then trcupdate $(LPP_FILESET1).undo; fi;\
	trcupdate $(LPP_FILESET1))

$(DNAME)_errids.h:	$(LPP_FILESET1).err
	errupdate -nh $(LPP_FILESET1).err
	mv $(LPP_FILESET1).err.h $(DNAME)_errids.h
	cp $(DNAME)_errids.h ../driver/pciwdt_errids.h

clean: 
	-@$(CLEAN_SHIP)

src:
	-@$(CLEAN_SHIP)
	@rm -f $(DNAME)_errids.h

spotless: 
	-@$(CLEAN_SHIP)
	-@$(TOUCH) lpp_name
