rainwoodman / tinypy

tpy, a pet python forked from tinypy
Other
21 stars 5 forks source link

Ocasional build error. #28

Closed rainwoodman closed 3 years ago

rainwoodman commented 3 years ago

e.g.

$ make
/home/yfeng1/.conda/envs/bccp/bin/x86_64-conda-linux-gnu-ar rcu modules/modules.a .objs/modules/modules.o .objs/modules/math/init.o .objs/modules/random/init.o .objs/modules/re/init.o
/home/yfeng1/.conda/envs/bccp/bin/x86_64-conda-linux-gnu-cc -o tpy .objs/tinypy/tp.o .objs/tinypy/compiler.o .objs/tinypy/runtime.o .objs/tinypy/tpmain.o modules/modules.a -lm
/home/yfeng1/.conda/envs/bccp/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: modules/modules.a(modules.o): in function `_tp_import_modules':
/home/yfeng1/source/tinypy/modules/modules.c:6: undefined reference to `math_init'

Improper file dependencies? This goes away if I do a make clean.

rofl0r commented 3 years ago

is the .a archive removed and rebuilt on every update ? proper make target should look like

foo.a: $(OBJS)
     rm foo.a
     ar rcu foo.a $(OBJS)
rainwoodman commented 3 years ago

Indeed the rm foo.a line is missing. I will reopen if this reoccurs. Thanks!