######################################################################
##
## Copyright (c) 1994  Carnegie Mellon University
## All rights reserved.
## 
## Use and copying of this software and preparation of derivative
## works based on this software are permitted, including commercial
## use, provided that the following conditions are observed:
## 
## 1. This copyright notice must be retained in full on any copies
##    and on appropriate parts of any derivative works.
## 2. Documentation (paper or online) accompanying any system that
##    incorporates this software, or any part of it, must acknowledge
##    the contribution of the Gwydion Project at Carnegie Mellon
##    University.
## 
## This software is made available "as is".  Neither the authors nor
## Carnegie Mellon University make any warranty about the software,
## its performance, or its conformity to any specification.
## 
## Bug reports, questions, comments, and suggestions should be sent by
## E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
##
######################################################################
##
##  $Header: /home/cvsroot/gd/src/Makegen,v 1.3.4.2 1999/01/09 15:21:13 emk Exp $
##
##  This is the makegen file for the entire Dylan tree.
##

## When bootstrapping stuff is compiled in a different order because the
## dependencies are different.  Also, when bootstrapping, we suppress actually
## running d2c.  See the d2c-compile target to actually bootstrap.


## Make force.timestamp if not there yet.
push(@compile_commands, "\$(MAKE) force.timestamp");
print <<'EOF'
force.timestamp:
	touch force.timestamp

EOF
;

if ($enable_mindy) {
    &compile_subdirs("mindy");
}
if ($enable_mindy_bootstrap) {
    push(@compile_commands, 
	 sprintf($host_platform{'recursive_make_command'}, 
		 "common", "dbc_only"));
    &compile_subdirs("d2c", "common");
    push(@compile_commands, 
	 sprintf($host_platform{'recursive_make_command'}, 
		 "d2c", "d2c-compile"));
    push(@compile_commands,
	 '@echo "Bootstrap complete; now install d2c, remove config.cache,"');
    push(@compile_commands,
	 '@echo "re-run configure, and make again."');
}
else {
    if ($enable_d2c) {
	&compile_subdirs("d2c");
    }
    &compile_subdirs("common", "tools", "tests", "demos");
}    
if ($features{'compiled_for_unix'}) {
    &compile_subdirs('doc');
}

push(@install_dependencies, "installdirs");
    
if ($features{'compiled_for_unix'}) {
    print <<"EOF"
installdirs:
	$srcdir/mkinstalldirs \${DESTDIR}$bindir \\
	   \${DESTDIR}$libdir \${DESTDIR}$libdir/elisp \\
	   \${DESTDIR}$includedir \${DESTDIR}$sysconfdir \\
           \${DESTDIR}$mandir/man1 \${DESTDIR}$mandir/man4 \\
           \${DESTDIR}$mandir/man7

EOF
;
} elsif ($features{'compiled_for_win32'}) {
    print <<"EOF"
installdirs:
	-mkdir \${DESTDIR}$bindir
	-mkdir \${DESTDIR}$libdir
       	-mkdir \${DESTDIR}$libdir\\elisp
       	-mkdir \${DESTDIR}$includedir
	-mkdir \${DESTDIR}$sysconfdir

EOF
;
} else {
    &unknown_platform_error();
}
