/****************************************************************************** * * Copyright (C) 1996-2005 Jason Evans . * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice(s), this list of conditions and the following disclaimer * unmodified other than the allowable addition of one or more * copyright notices. * 2. Redistributions in binary form must reproduce the above copyright * notice(s), this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** * * Version: Onyx 5.1.2 * * Cooked master Cookfile. * ******************************************************************************/ /* * Given [CPPFLAGS], filter out everything but -I flags. This is typically used * in preparation for calling c_incl, which doesn't recognize flags such as the * -D flag. */ function filter_cppdefs = { local cppflags = [arg]; cppflags = [unsplit " " [cppflags]]; cppflags = [subst " -I " " -I" [cppflags]]; cppflags = [split " " [cppflags]]; cppflags = [filter -I%0% [cppflags]]; return [cppflags]; } /* * Make sure file timestamps are at least 1 second apart for all adjacent * dependency nodes. */ set time-adjust; /* * Standard definitions. */ /* Installation prefixes. */ if [not [defined PREFIX]] then { PREFIX = [split " " [strip "@PREFIX@"]]; if [not [defined BINDIR]] then BINDIR = [split " " [strip "@BINDIR@"]]; if [not [defined DATADIR]] then DATADIR = [split " " [strip "@DATADIR@"]]; if [not [defined LIBDIR]] then LIBDIR = [split " " [strip "@LIBDIR@"]]; if [not [defined INCLUDEDIR]] then INCLUDEDIR = [split " " [strip "@INCLUDEDIR@"]]; if [not [defined MANDIR]] then MANDIR = [split " " [strip "@MANDIR@"]]; } else { /* Implicitly override all installation paths using [PREFIX], but take * care to still honor explicit overrides. */ if [not [defined BINDIR]] then BINDIR = [PREFIX]/bin; if [not [defined DATADIR]] then DATADIR = [PREFIX]/share; if [not [defined LIBDIR]] then LIBDIR = [PREFIX]/lib; if [not [defined INCLUDEDIR]] then INCLUDEDIR = [PREFIX]/include; if [not [defined MANDIR]] then MANDIR = [PREFIX]/man; } /* Paths to programs used by the build system. */ SHELL = /bin/sh; if [not [defined HCC]] then HCC = [split " " [strip "@HCC@"]]; if [not [defined TCC]] then TCC = [split " " [strip "@TCC@"]]; /* Build parameters. */ if [not [defined CPPFLAGS]] then CPPFLAGS = [split " " [strip "@CPPFLAGS@"]]; if [not [defined CFLAGS]] then CFLAGS = [split " " [strip "@CFLAGS@"]]; A_CFLAGS = [CFLAGS]; S_CFLAGS = [CFLAGS] -fPIC -DPIC #if [matches macho @abi@] -dynamic #endif ; if [not [defined LDFLAGS]] then LDFLAGS = [split " " [strip "@LDFLAGS@"]]; #if @enable_autogen@ /* * Re-configuration rules. */ @srcroot@/aclocal.m4 : @srcroot@/acinclude.m4 { cd @srcroot@/\; @ACLOCAL@; } @srcroot@/configure : @srcroot@/configure.in @srcroot@/aclocal.m4 { cd @srcroot@/\; @AUTOCONF@; } @objroot@/config.status : @srcroot@/configure { @objroot@/config.status --recheck; } [fromto @objroot@/%0% @srcroot@/%0%.in [filter_out @objroot@/config.stamp @cfghdrs@]] : @srcroot@/configure.in; @objroot@/config.stamp : [fromto @objroot@/%0% @srcroot@/%0%.in [filter_out @objroot@/config.stamp @cfghdrs@]] @objroot@/config.status { @objroot@/config.status; } [addprefix @objroot@/ @cfgoutputs@] : [prepost @srcroot@/ .in @cfgoutputs@] @objroot@/config.stamp { @objroot@/config.status; } #endif /* Documentation. */ #include-cooked @objroot@/doc/Cookfile.inc /* Tests. */ #include-cooked @objroot@/test/Cookfile.inc /* Binaries. */ #include-cooked @objroot@/bin/Cookfile.inc /* Libraries. */ #include-cooked @objroot@/lib/Cookfile.inc /* Modules. */ #include-cooked @objroot@/mod/Cookfile.inc /* * User targets. */ /* * Leave tests out, since they aren't generally necessary when building and * installing. */ all : libs mods bins docs set default ; bootstrap : [addsuffix _bootstrap bins libs]; release : docs; install : [addsuffix _install bins mods libs docs]; uninstall : [addsuffix _uninstall bins mods libs docs]; clean : [addsuffix _clean docs tests bins mods libs] { /* * Delete .cook.fp files from the source tree and object tree. * Delete Cookfile.list files from the object tree. */ [SHELL] -e; data #![SHELL] for i in `find @srcroot@ -type f -name .cook.fp` ; do echo rm $i; rm $i; done for i in `find @objroot@ -type f -name .cook.fp` ; do echo rm $i; rm $i; done for i in `find @objroot@ -type f -name Cookfile.list` ; do echo rm $i; rm $i; done dataend } distclean : clean [addsuffix _distclean tests bins mods libs] { { local cachedir = [glob @objroot@/autom4te"*".cache]; if [count [cachedir]] then rm -rf [cachedir]; } rm -f @objroot@/config.log; rm -f @objroot@/config.status; rm -f @objroot@/config.stamp; rm -f @objroot@/configure.lineno; rm -f @cfghdrs@; rm -f @cfgoutputs@; } relclean : distclean [addsuffix _relclean docs] { rm -f @objroot@/aclocal.m4; rm -f @objroot@/configure; } /* * Rules for generation of C code from Onyx code. These rules assume a * stylized file naming convention, which all the pertinent source files * conform to. */ @objroot@/%0%_nxcode.c : @objroot@/%0%.nx @srcroot@/%0%_gen.nx [BONYX] set mkdir { cat @objroot@/%0%.nx | [BONYX] @srcroot@/%0%_gen.nx > [target]; } @objroot@/%0%_objdir.c : @objroot@/%0%.nx @objroot@/%0%_gen.nx [BONYX] set mkdir { cat @objroot@/%0%.nx | [BONYX] @objroot@/%0%_gen.nx -B -D > [target]; } @objroot@/%0%_dstdir.c : @objroot@/%0%.nx @objroot@/%0%_gen.nx [BONYX] set mkdir { cat @objroot@/%0%.nx | [BONYX] @objroot@/%0%_gen.nx -B -d > [target]; }