summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-17 14:13:17 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-17 14:13:17 +0000
commit05b111d6a245725c81a314794fb95e8375fb6720 (patch)
tree54553740e0b831fa65926aa9aef093e7bc490733
parent3a186342c975a8bbd3f588d180a55e381b31883c (diff)
Update make help, configure, and fix build of empty m_* directories
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11739 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--.Makefile.inc9
-rwxr-xr-xconfigure1
-rwxr-xr-xmake/calcdep.pl21
3 files changed, 18 insertions, 13 deletions
diff --git a/.Makefile.inc b/.Makefile.inc
index 4f619feac..1eda95f80 100644
--- a/.Makefile.inc
+++ b/.Makefile.inc
@@ -186,6 +186,7 @@ configureclean:
rm -f BSDmakefile
rm -f GNUmakefile
rm -f include/inspircd_config.h
+ rm -f include/inspircd_version.h
rm -f include/inspircd_se_config.h
distclean: clean configureclean
@@ -198,7 +199,6 @@ help:
@echo 'Flags:'
@echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
@echo ' D=1 Enable debug build, for module development or crash tracing'
- @echo ' O=objdir Use an alternate location for storing object files'
@echo ' -j <N> Run a parallel build using N jobs'
@echo ''
@echo 'User targets:'
@@ -207,10 +207,9 @@ help:
@echo ' Currently installs to ${BASE}'
@echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
@echo ''
- @echo ' M=m_foo Builds a single module'
- @echo ' T=target Builds a user-specified target'
- @echo ' Target can be a file path relative to src/, or one of:'
- @echo ' inspircd commands modules'
+ @echo ' M=m_foo Builds a single module (cmd_foo also works here)'
+ @echo ' T=target Builds a user-specified target, such as "inspircd" or "modules"'
+ @echo ' Other targets are specified by their path in the build directory'
@echo ' Multiple targets may be separated by a space'
@echo ''
@echo ' clean Cleans object files produced by the compile'
diff --git a/configure b/configure
index e0b2dd6b5..2fc199479 100755
--- a/configure
+++ b/configure
@@ -139,6 +139,7 @@ if (defined $opt_base_dir)
$config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory
$config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
$config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
+$config{BUILD_DIR} = resolve_directory($config{ME}."/build"); # Build Directory
if (defined $opt_config_dir)
{
diff --git a/make/calcdep.pl b/make/calcdep.pl
index 1a65f836b..05199569c 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
-use Getopt::Long;
+use POSIX qw(getcwd);
sub find_output($);
sub gendep($);
@@ -22,8 +22,7 @@ sub run() {
mkdir 'obj';
mkdir 'modules';
symlink "$ENV{SOURCEPATH}/include", 'include';
- $build = `pwd`;
- chomp $build;
+ $build = getcwd();
open MAKE, '>real.mk' or die "Could not write real.mk: $!";
chdir "$ENV{SOURCEPATH}/src";
@@ -52,9 +51,10 @@ END
opendir my $moddir, 'modules';
for my $dir (readdir $moddir) {
next unless $dir =~ /^m_/ && -d "modules/$dir";
- mkdir "$build/obj/$dir";
- dep_dir "modules/$dir";
- push @modlist, "modules/$dir.so";
+ if (dep_dir "modules/$dir") {
+ mkdir "$build/obj/$dir";
+ push @modlist, "modules/$dir.so";
+ }
}
my $core_mk = join ' ', @core_deps;
@@ -141,7 +141,12 @@ sub dep_dir($) {
push @ofiles, $ofile;
}
closedir DIR;
- my $ofiles = join ' ', @ofiles;
- print MAKE "$dir.so: $ofiles\n\t\$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^\n";
+ if (@ofiles) {
+ my $ofiles = join ' ', @ofiles;
+ print MAKE "$dir.so: $ofiles\n\t\$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^\n";
+ return 1;
+ } else {
+ return 0;
+ }
}