# Makerules: how to do some things.

# Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.

# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
#
# THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
# "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.

#
# Building foo.h from foo.sym.
#

EXTRA_DIST += \
	gensym.awk
%.symc: %.sym gensym.awk
	$(AWK_V) $(AWK) -f $(word 2,$^) $< > $@
%.symc.o: %.symc
	$(AM_V_CC) $(COMPILE) -S -x c -o $@ $<
%.h: %.symc.o
	$(AM_V_GEN) sed < $< > $@		\
	  -e 's/^[^*].*$$//'			\
	  -e 's/^[*]/#define/'			\
	  -e 's/mAgIc[^-0-9]*//'

# Makerules.mig: how to do some MIG-related things.
include Makerules.mig.am

#
# gzip files.
#

%.gz: %
	$(GZIP_V) $(GZIP) -9 < $< > $@

#
# strip files.
#

%.stripped: %
	$(STRIP) -o $@ $<

#
# Echo target.
#

echo-%:
	@echo '$* = `$($*)'\'