Update of /cvsroot/anet/ANet/ANet_Daemon/Linux
In directory usw-pr-cvs1:/tmp/cvs-serv15972/ANet_Daemon/Linux
Added Files:
Makefile.in build_exclusion.txt build_locations.txt
build_makefile.pl
Log Message:
""
--- NEW FILE: Makefile.in ---
SHELL = /bin/sh
# Add paths to all the headers here.
header_paths = -I. -I../Common -I../Core -I../Common/Lists
# Change compiler options here
compiler = gcc -g ${header_paths} -Wall
# Add source and header files paths here
vpath %.c .
vpath %.c ../Common/
vpath %.c ../Common/Lists/
vpath %.c ../Core/
vpath %.h .
vpath %.h ../Common/
vpath %.h ../Common/Lists/
vpath %.h ../Core/
# Default rule to compile *.c files.
%.o: %.c
${compiler} -c $< -o $@
# Special targets below.
all: anetd
clean: build_clean
rm -f anetd
build_clean:
rm -f *.o
.PHONY: all clean build_clean
--- NEW FILE: build_exclusion.txt ---
sample.c
IMC.c
StubModule.c
ModuleLoader.c
--- NEW FILE: build_locations.txt ---
.
../Common
../Common/Lists
../Core
--- NEW FILE: build_makefile.pl ---
#!/usr/bin/perl
use strict;
sub main();
main();
sub main()
{
if ($ARGV[0] eq '--help')
{
print "help info...\n";
return;
}
my @fileExclusionList;
open(EXCLUSION, 'build_exclusion.txt');
while (<EXCLUSION>)
{
chop();
push(@fileExclusionList, $_);
}
close(EXCLUSION);
my @fileList;
open(DIRLIST, 'build_locations.txt');
while (<DIRLIST>)
{
chop();
opendir(DIR, $_);
my @files = readdir(DIR);
for my $item (@files)
{
$item =~ /^(.*)\.[ch]$/;
my $exclude = 0;
foreach my $compare (@fileExclusionList)
{
if ($compare eq $item)
{
$exclude = 1;
last;
}
}
if (-f "$_/$item" && !$exclude &&
-r "$_/$item" && $1)
{
push(@fileList, "$_/$item");
}
}
closedir(DIR);
}
close(DIRLIST);
my @objectList;
foreach my $file (@fileList)
{
#print "$file\n";
$file =~ m:^.*/(.*?\.[hc]):;
my $fileName = $1;
my @headers;
open(FILE, $file);
while (<FILE>)
{
chop();
if (/^\#include *\"(.*?)\"/)
{
my $exclude = 0;
foreach my $compare (@fileExclusionList)
{
if ($compare eq $1)
{
$exclude = 1;
last;
}
}
if (!$exclude)
{
push(@headers, $1);
}
}
}
close(FILE);
if ($fileName =~ /^(.*?).h$/)
{
if ($#headers >= 0)
{
print "$fileName:";
foreach my $header (@headers)
{
print " $header";
}
print "\n\t\@touch $file\n";
}
}
elsif ($fileName =~ /^(.*?).c$/)
{
push(@objectList, "$1.o");
if ($#headers >= 0)
{
print "$fileName:";
foreach my $header (@headers)
{
print " $header";
}
print "\n";
}
}
}
print "anetd:";
foreach my $objectFile (@objectList)
{
print " $objectFile";
}
print "\n\t";
print '${compiler} $^ -lm -o anetd';
print "\n";
}
|