diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-20 01:17:04 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-20 01:17:04 +0000 |
commit | 43ea75c0b3b64f1ebde2c7048a64d1f5bb3242fe (patch) | |
tree | aea7953750842e91efbcdf3cc15fefefc7e6c788 | |
parent | 9facfd70b5a8ca4dca16fc93f6fcfe1c2bf6ce0f (diff) |
Move ugly .*.inc files into make/template/ where they can be more easily found
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11929 e03df62e-2008-0410-955e-edbf42e46eb7
-rwxr-xr-x | configure | 114 | ||||
-rw-r--r-- | make/template/inspircd (renamed from .inspircd.inc) | 0 | ||||
-rw-r--r-- | make/template/main.mk (renamed from .Makefile.inc) | 4 | ||||
-rw-r--r-- | make/template/org.inspircd.plist (renamed from .org.inspircd.plist.inc) | 0 | ||||
-rw-r--r-- | src/configreader.cpp | 2 | ||||
-rw-r--r-- | tools/gdbargs (renamed from .gdbargs) | 0 |
6 files changed, 56 insertions, 64 deletions
@@ -1044,74 +1044,66 @@ EOF # but right now we only parse .inspircd.inc to form './inspircd' prepare_dynamic_makefile(); - print "Writing \e[1;32mMakefiles\e[0m\n"; + my @dotfiles = qw(main.mk inspircd); + push @dotfiles, 'org.inspircd.plist' if $config{OSNAME} eq 'darwin'; - opendir(DIRHANDLE, $this); - - foreach my $name (sort readdir(DIRHANDLE)) { - if ($name =~ /^\.(.+)\.inc$/) { - $file = $1; - - # Bug #353, omit this on non-darwin - next if (($config{OSNAME} !~ /darwin/) && ($file eq "org.inspircd.plist")); + foreach my $file (@dotfiles) { + open(FILEHANDLE, "make/template/$file") or die "Can't open make/template/$file: $!"; + $_ = join '', <FILEHANDLE>; + close(FILEHANDLE); - # All .name.inc files need parsing! - open(FILEHANDLE, ".$file.inc") or die ("Can't open .$file.inc"); - $_ = join '', <FILEHANDLE>; - close(FILEHANDLE); + $config{BUILD_DIR} ||= resolve_directory($config{ME}."/build"); + for my $var (qw( + CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR + STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE + )) { + s/\@$var\@/$config{$var}/g; + } + s/\@EXECUTABLE\@/$exe/ if defined $exe; + s/\@VERSION\@/$version/ if defined $version; + + if ($file eq 'main.mk') { + print "Writing \e[1;32mGNUmakefile\e[0m ...\n"; + + my $mk_tmp = $_; + s/\@IFDEF (\S+)/ifdef $1/g; + s/\@IFNDEF (\S+)/ifndef $1/g; + s/\@IFEQ (\S+) (\S+)/ifeq ($1,$2)/g; + s/\@ELSIFEQ (\S+) (\S+)/else ifeq ($1,$2)/g; + s/\@ELSE/else/g; + s/\@ENDIF/endif/g; + s/ *\@BSD_ONLY .*\n//g; + s/\@GNU_ONLY //g; + s/\@DO_EXPORT (.*)/export $1/g; + open MKF, '>GNUmakefile' or die "Can't write to GNUmakefile: $!"; + print MKF $_; + close MKF; + + print "Writing \e[1;32mBSDmakefile\e[0m ...\n"; + $_ = $mk_tmp; + s/\@IFDEF (\S+)/.if defined($1)/g; + s/\@IFNDEF (\S+)/.if !defined($1)/g; + s/\@IFEQ (\S+) (\S+)/.if $1 == $2/g; + s/\@ELSIFEQ (\S+) (\S+)/.elif $1 == $2/g; + s/\@ELSE/.else/g; + s/\@ENDIF/.endif/g; + s/\@BSD_ONLY //g; + s/ *\@GNU_ONLY .*\n//g; + $mk_tmp = $_; + $mk_tmp =~ s#\@DO_EXPORT (.*)#"MAKEENV += ".join ' ', map "$_='\${$_}'", split /\s/, $1#eg; + open MKF, '>BSDmakefile' or die "Can't write to BSDmakefile: $!"; + print MKF $mk_tmp; + close MKF; + } else { print "Writing \e[1;32m$file\e[0m ...\n"; - - $config{BUILD_DIR} ||= resolve_directory($config{ME}."/build"); - - for my $var (qw( - CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR - STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE - )) { - s/\@$var\@/$config{$var}/g; - } - s/\@EXECUTABLE\@/$exe/ if defined $exe; - s/\@VERSION\@/$version/ if defined $version; - - if ($file eq 'Makefile') { - my $mk_tmp = $_; - s/\@IFDEF (\S+)/ifdef $1/g; - s/\@IFNDEF (\S+)/ifndef $1/g; - s/\@IFEQ (\S+) (\S+)/ifeq ($1,$2)/g; - s/\@ELSIFEQ (\S+) (\S+)/else ifeq ($1,$2)/g; - s/\@ELSE/else/g; - s/\@ENDIF/endif/g; - s/ *\@BSD_ONLY .*\n//g; - s/\@GNU_ONLY //g; - s/\@DO_EXPORT (.*)/export $1/g; - open MKF, '>GNUmakefile' or die "Can't write to GNUmakefile: $!"; - print MKF $_; - close MKF; - $_ = $mk_tmp; - s/\@IFDEF (\S+)/.if defined($1)/g; - s/\@IFNDEF (\S+)/.if !defined($1)/g; - s/\@IFEQ (\S+) (\S+)/.if $1 == $2/g; - s/\@ELSIFEQ (\S+) (\S+)/.elif $1 == $2/g; - s/\@ELSE/.else/g; - s/\@ENDIF/.endif/g; - s/\@BSD_ONLY //g; - s/ *\@GNU_ONLY .*\n//g; - $mk_tmp = $_; - $mk_tmp =~ s#\@DO_EXPORT (.*)#"MAKEENV += ".join ' ', map "$_='\${$_}'", split /\s/, $1#eg; - open MKF, '>BSDmakefile' or die "Can't write to BSDmakefile: $!"; - print MKF $mk_tmp; - close MKF; - } else { - open(FILEHANDLE, ">$file") or die("Can't write to $file: $!\n"); - print FILEHANDLE $_; - close(FILEHANDLE); - } + open(FILEHANDLE, ">$file") or die("Can't write to $file: $!\n"); + print FILEHANDLE $_; + close(FILEHANDLE); } } - closedir(DIRHANDLE); - # Make inspircd executable! - chmod 0744, 'inspircd'; + chmod 0755, 'inspircd'; } sub depcheck diff --git a/.inspircd.inc b/make/template/inspircd index 05cbe0ea0..05cbe0ea0 100644 --- a/.inspircd.inc +++ b/make/template/inspircd diff --git a/.Makefile.inc b/make/template/main.mk index e5c1c940e..953c6bf4e 100644 --- a/.Makefile.inc +++ b/make/template/main.mk @@ -159,8 +159,8 @@ install: target@EXTRA_DIR@ @echo "* REMEMBER TO EDIT YOUR CONFIG FILE *" @echo "*************************************" -@GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries) -@GNU_ONLY GNUmakefile: .Makefile.inc configure .config.cache $(RCS_FILES) +@GNU_ONLY RCS_FILES = $(wildcard .git/index .svn/entries .config.cache) +@GNU_ONLY GNUmakefile: make/template/main.mk configure $(RCS_FILES) @GNU_ONLY ./configure -update clean: diff --git a/.org.inspircd.plist.inc b/make/template/org.inspircd.plist index 3112d51b1..3112d51b1 100644 --- a/.org.inspircd.plist.inc +++ b/make/template/org.inspircd.plist diff --git a/src/configreader.cpp b/src/configreader.cpp index 879aeaa8e..6932e960e 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -23,7 +23,7 @@ /* $CopyInstall: conf/modules.conf.example $(CONPATH) */ /* $CopyInstall: conf/opers.conf.example $(CONPATH) */ /* $CopyInstall: conf/links.conf.example $(CONPATH) */ -/* $CopyInstall: .gdbargs $(BASE) */ +/* $CopyInstall: tools/gdbargs $(BASE)/.gdbargs */ #include "inspircd.h" #include <fstream> diff --git a/.gdbargs b/tools/gdbargs index 244c1b29c..244c1b29c 100644 --- a/.gdbargs +++ b/tools/gdbargs |