# Makerules: how to do some things. # Copyright 2006 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) -f $(word 2,$^) $< > $@ %.symc.o: %.symc $(COMPILE) -S -x c -o $@ $< %.h: %.symc.o sed < $< > $@ \ -e 's/^[^*].*$$//' \ -e 's/^[*]/#define/' \ -e 's/mAgIc[^-0-9]*//' # # Building RPC stubs. # # These chained rules could be (and used to be) single rules using pipes or # could even --- if you dare to --- use the `mig' shell script, but it's # convenient to be able to explicitly make the intermediate files when you want # to deal with a problem in the MIG stub generator. # TODO. Get rid of the following six rules and the lib_dep_tr_for_defs.a # machinery (see Makefrag.am and i386/Makefrag.am). %.server.defs.c: %.srv rm -f $@ cp -p $< $@ %.user.defs.c: %.cli rm -f $@ cp -p $< $@ %.server.h %.server.c: lib_dep_tr_for_defs_a-%.server.defs.$(OBJEXT) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \ -sheader $*.server.h -server $*.server.c \ -user /dev/null -header /dev/null \ < $< %.server.msgids: lib_dep_tr_for_defs_a-%.server.defs.$(OBJEXT) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \ -n -list $@ \ < $< %.user.h %.user.c: lib_dep_tr_for_defs_a-%.user.defs.$(OBJEXT) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \ -user $*.user.c -server /dev/null -header $*.user.h \ < $< %.user.msgids: lib_dep_tr_for_defs_a-%.user.defs.$(OBJEXT) $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \ -n -list $@ \ < $< # TODO. Get rid of the .srv files and rather use .defs files and MIG*SFLAGS? %.server.defs: %.srv $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $< %.server.defs: %.defs $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGSFLAGS) -o $@ $< %.server.h %.server.c: %.server.defs $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \ -sheader $*.server.h -server $*.server.c \ -user /dev/null -header /dev/null \ < $< # TODO. Get rid of the .cli files and rather use .defs files and MIG*UFLAGS? %.user.defs: %.cli $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $< %.user.defs: %.defs $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGUFLAGS) -o $@ $< %.user.h %.user.c: %.user.defs $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \ -user $*.user.c -server /dev/null -header $*.user.h \ < $< # # gzip files. # %.gz: % $(GZIP) -9 < $< > $@ # # strip files. # %.stripped: % $(STRIP) -o $@ $< # # Echo target. # echo-%: @echo '$* = `$($*)'\'