On 2010-09-11 21:06Z, Axel wrote:
[...]
> My program runs fine when I type "make run" (the binary is executed
> through the Makefile, see the attached file). When I run it by hand or
> using gdb (or with python popen4) the thread which manage the new
> connections (accept() on the main thread socket) cannot accept them
> (accept() returns -1 with errno to "Invalid argument"). I tried to put
> the thread code in the main and it worked whether I was using gmake or
> not.
The makefile says:
.PHONY: run
run: build
@cd $(DEBUGDIR); ./$(EXEC)
debugrun: build
@cd $(DEBUGDIR); gdb ./$(EXEC)
and it sounds like the first target works, the second fails, and it
also fails if you run the first target's recipe on the command line:
# substituting variables in "cd $(DEBUGDIR); ./$(EXEC)":
$cd build/debug; ./main
> So my conclusion is that gmake/my Makefile affects the program execution
> via permissions of the thread socket/ressource sharing or something like
> this. It maybe something else but I wasn't able to reproduce it anywhere
> but with gmake. I'm lost in an unknown land and looking for some help.
To verify what command 'make' is issuing, run 'make -d run' or at
least remove the '@' above. For the 'run' target, it should run this
command in a '/bin/sh' subshell:
cd build/debug; ./main
which, however, fails if you paste it into your interactive shell.
Could the cause be something like an uninitialized pointer in 'main'?
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make