egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
69 stars 17 forks source link

`Makefile` is trying to build `list.so` before `list.o` is available #556

Closed jpellegrini closed 1 year ago

jpellegrini commented 1 year ago

Hi @egallesio !

It seems that the Makefile is trying to build list.so before list.o is available:

gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o list.o list.c
gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o flonum.o flonum.c
gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o sort.o sort.c
gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o bytevector.o bytevector.c
make[4]: Leaving directory '/home/jeronimo/pkg/scheme/STklos/lib/srfi'
../../utils/tmpcomp -o bitwise.ostk bitwise.stk
gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o list.o list.c
gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o vector.o vector.c
gcc -g -Wall -Wextra -O2  -fpic -nostdlib -I../../src   -c -o ilist.o ilist.c
ld -shared -o list.so list.o 
../../utils/tmpcomp -o ideque.ostk ideque.stk
ld -shared -o list.so list.o 
ld: cannot find list.o: No such file or directory
make[5]: *** [Makefile:847: list.so] Error 1
make[5]: Leaving directory '/home/jeronimo/pkg/scheme/STklos/lib/scheme'
make[4]: *** [Makefile:675: ../scheme/list.so] Error 2
make[4]: Leaving directory '/home/jeronimo/pkg/scheme/STklos/lib/streams'
make[3]: *** [Makefile:863: ../streams/derived.ostk] Error 2
make[3]: *** Waiting for unfinished jobs....
ld -shared -o vector.so vector.o 
ld -shared -o ilist.so ilist.o 
ld -shared -o sort.so sort.o 
ld -shared -o bytevector.so bytevector.o 
ld -shared -o flonum.so flonum.o 
make[3]: Leaving directory '/home/jeronimo/pkg/scheme/STklos/lib/scheme'
make[2]: *** [Makefile:572: all-recursive] Error 1
make[2]: Leaving directory '/home/jeronimo/pkg/scheme/STklos/lib/scheme'
make[1]: *** [Makefile:557: all-recursive] Error 1
make[1]: Leaving directory '/home/jeronimo/pkg/scheme/STklos/lib'
make: *** [Makefile:437: all-recursive] Error 1

A missing dependency?

egallesio commented 1 year ago

Hi @jpellegrini,

I think that Makefiles are correct:

$ grep  "scheme[. ]list" **/*.stk
lib/scheme/ideque.stk:  (import (scheme list)         ;; (srfi 1)
lib/scheme/vector.stk:(from-scheme list->vector)
lib/srfi/1.stk:;;;; The real implementation is in (scheme list).
lib/srfi/43.stk:(from-scheme list->vector)
lib/srfi/117.stk:;;;; The real implementation is in (scheme list-queue).
lib/streams/derived.stk:          (scheme list))
tests/srfis/144.stk:;;    ((library (scheme list))
tests/srfis/144.stk:;;     (import (only (scheme list) filter iota)))

So, it seems that the only compiled files that import (scheme list) are ideque.stk, vector.stk and derived.stk. All these files have a dependency on lib/scheme/list.so which seems correct.

The only weird thing I've seen is that streams.ostk has a dependency to list.so instead of primitive.ostk, but it doesn't explain the problem (on contrary, it is a useless dependency).

All my attempts (30 times make distclean + make tests) to have the problem failed. Can you test on your side, please. Thanks by advance.

jpellegrini commented 1 year ago

Hi @egallesio ! It seems to have been fixed. Thanks a lot! :)