[Aldor-l] different libraries that contain files with same name
Ralf Hemmecke
ralf at hemmecke.de
Mon Nov 26 19:06:58 EST 2007
Hello,
maybe all of you know, but I would really like to know why there is this
restriction that I cannot have two libraries that contain the same
filename. Why does the file name in different object libraries matter at
all?
This problem does not occur for pure C code see below.
Any suggestion for a workaround?
Ralf
woodpecker:~/scratch/AAABBB>make -s clean all && ccc
ar: creating libaaa.al
a - libaaa.ao
rm: cannot remove `myfile.as': No such file or directory
ar: creating libaaa.a
a - libaaa.o
ar: creating libbbb.al
a - libbbb.ao
rm: cannot remove `myfile.as': No such file or directory
ar: creating libbbb.a
a - libbbb.o
I am AAA
You are BBB
woodpecker:~/scratch/AAABBB>make -s FILE=myfile clean all && ccc
ar: creating libaaa.al
a - myfile.ao
ar: creating libaaa.a
a - myfile.o
ar: creating libbbb.al
a - myfile.ao
ar: creating libbbb.a
a - myfile.o
Segmentation fault
---BEGIN libaaa.as
#include "aldor"
AAA: with {foo: () -> String} == add {
foo(): String == "I am AAA";
}
---END libaaa.as
------------------------------------------------------------------
---BEGIN libbbb.as
#include "aldor"
BBB: with {bar: () -> String} == add {
bar(): String == "You are BBB";
}
---END libbbb.as
------------------------------------------------------------------
---BEGIN ccc.as
#include "aldor"
#include "aldorio"
#library BBBLIB "bbb"
#library AAALIB "aaa"
import from BBBLIB, AAALIB;
stdout << foo()$AAA << newline;
stdout << bar()$BBB << newline;
---END ccc.as
------------------------------------------------------------------
---BEGIN Makefile
ALDORROOT=/path/to/aldorroot
ALDOR=$(ALDORROOT)/bin/aldor
export ALDORROOT ALDOR
all:
$(MAKE) LIB=libaaa library
$(MAKE) LIB=libbbb library
$(MAKE) ccc
FILE=${LIB}
library: ${LIB}.a
${LIB}.a: ${LIB}.al ${LIB}.a(${FILE}.o)
ranlib $@
${LIB}.al: ${LIB}.al(${FILE}.ao)
${LIB}.al(%.ao): %.as
$(ALDOR) $<
ar rv ${LIB}.al $*.ao
-rm myfile.as
${LIB}.a(%.o): ${LIB}.al(%.ao)
@echo Compiling $*.ao --> $*.o ... ;
ar x ${LIB}.al $*.ao;
${ALDOR} -fo $*.ao;
$(RM) $*.ao;
ar rv ${LIB}.a $*.o
$(RM) $*.o
myfile.as: ${LIB}.as
cp $< $@
ccc: ccc.as
$(ALDOR) -fx -lbbb -laaa -laldor $<
clean:
${RM} lib*.al lib*.a myfile.as *~ ccc
---END Makfile
=====================================================================
=====================================================================
woodpecker:~/scratch/CCC>make -s FILE=myfile clean all && ccc
ar: creating libaaa.a
a - myfile.o
ar: creating libbbb.a
a - myfile.o
Main World!
Hello AAA World!
Hello BBB World!
End of World!
woodpecker:~/scratch/CCC>ar t libaaa.a
myfile.o
woodpecker:~/scratch/CCC>ar t libbbb.a
myfile.o
=====================================================================
---BEGIN libaaa.c
#include <stdio.h>
int aaa(void) {puts("Hello AAA World!"); return 0;}
---END libaaa.c
------------------------------------------------------------------
---BEGIN libbbb.c
#include <stdio.h>
int bbb(void) {puts("Hello BBB World!"); return 0;}
---END libbbb.c
------------------------------------------------------------------
---BEGIN ccc.c
#include <stdio.h>
int main (void)
{
puts ("Main World!");
aaa();
bbb();
puts ("End of World!");
}
---END ccc.c
------------------------------------------------------------------
---BEGIN Makefile
all:
$(MAKE) LIB=libaaa library
$(MAKE) LIB=libbbb library
$(MAKE) ccc
FILE=${LIB}
library: ${LIB}.a
${LIB}.a: ${LIB}.a(${FILE}.o)
ranlib $@
${LIB}.a(%.o): %.c
$(CC) -c $<
ar rv ${LIB}.a $*.o
-rm $*.o
-rm myfile.c
myfile.c: ${LIB}.c
cp $< $@
ccc: ccc.c
$(CC) -o ccc $< libbbb.a libaaa.a
clean:
${RM} lib*.a myfile.c *.o *.s *~ ccc
---END Makfile
-------------- next part --------------
A non-text attachment was scrubbed...
Name: problem.tar.gz
Type: application/gzip
Size: 1105 bytes
Desc: not available
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20071127/36f88e79/attachment-0002.bin>
More information about the Aldor-l
mailing list