$modname=$ARGV[0];
}
+my $rootpath;
+if($#ARGV >= 1) {
+ $rootpath=$ARGV[1];
+} else {
+ $rootpath="..";
+}
+
my $smallname;
$smallname=$modname;
$smallname=~s/\.so$//;
open CL, ">commandlist.c";
print CL "/* Automatically generated by mkcommandlist.pl, do not edit. */\n\n";
-print CL "#include \"../chanserv.h\"\n\n";
+print CL "#include \"".$rootpath."/chanserv.h\"\n\n";
# Print prototypes
print CL "/* Prototypes */\n";
close CL;
-open MF,">autobuild.mk";
+open MF,">.autobuild.mk";
print MF "# Automatically generated Makefile, do not edit.\n";