• Re: utelnetd from 2012 and `make DEBUG=1`

    From Geert Stappers@21:1/5 to Jeffrey Walton on Sun Nov 10 08:40:01 2024
    On Sat, Nov 09, 2024 at 10:39:32PM -0500, Jeffrey Walton wrote:
    On Sat, Nov 9, 2024 at 10:18 PM <peter@easthope.ca> wrote:

    Retrieved utelnetd 0.1.11 from here. https://public.pengutronix.de/software/utelnetd/

    Installed gcc and tried make.
    # make DEBUG=1 -f ./Makefile
    make: Nothing to be done for 'all'.
    #

    :-)


    This is the "all" stanza in Makefile.

    all: $(PROGS)

    $(PROGS): $(OBJS)
    $(CC) $(LDFLAGS) $(CFLAGS) $^ $(LDLIBS) -o $@
    $(STRIP) --remove-section=.comment --remove-section=.note $@

    Is the problem in all? Elsewhere?

    My guess is $PROGS is empty. But it is only a guess since the message
    is missing so much information.

    Maybe add a $(info $(PROGS)) before the 'all' recipe to see:

    $(info PROGS: $(PROGS))
    all: $(PROGS)


    Curious about "info" in the Makefile, I tired it.
    And I learnt it is "print".


    Back to the original
    make: Nothing to be done for 'all'.

    It means "Request allready executed", it is worded
    as "Nothing to be done"


    Do `make clean` and then `make DEBUG=1`.


    Jeff

    Groeten
    Geert Stappers



    <screenshot
    note_1="Regular user, not root. Note the $, versus the # by original poster."
    note_2="There is no need for `-f Makefile`."
    note_3="Lines with `PROGS: utelnet` are artifact of `$(info PROGS: $(PROGS))`"

    stappers@paddy:~/src/utelnetd-0.1.11
    $ make clean
    PROGS: utelnetd
    rm -f utelnetd *.o core
    stappers@paddy:~/src/utelnetd-0.1.11
    $ make
    PROGS: utelnetd
    gcc -I. -pipe -DSHELLPATH=\"/bin/login\" -Wall -fomit-frame-pointer -c -o utelnetd.o utelnetd.c
    utelnetd.c: In function 'getpty':
    utelnetd.c:232:13: warning: implicit declaration of function 'grantpt'; did you mean 'getpt'? [-Wimplicit-function-declaration]
    232 | if (grantpt(p)<0 || unlockpt(p)<0) {
    | ^~~~~~~
    | getpt
    utelnetd.c:232:29: warning: implicit declaration of function 'unlockpt' [-Wimplicit-function-declaration]
    232 | if (grantpt(p)<0 || unlockpt(p)<0) {
    | ^~~~~~~~
    utelnetd.c:238:35: warning: implicit declaration of function 'ptsname'; did you mean 'ptsname_r'? [-Wimplicit-function-declaration]
    238 | strcpy(line, (const char*)ptsname(p));
    | ^~~~~~~
    | ptsname_r
    utelnetd.c:238:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    238 | strcpy(line, (const char*)ptsname(p));
    | ^
    utelnetd.c: In function 'make_new_session':
    utelnetd.c:264:17: warning: variable 't2' set but not used [-Wunused-but-set-variable]
    264 | int t1, t2;
    | ^~
    utelnetd.c:264:13: warning: variable 't1' set but not used [-Wunused-but-set-variable]
    264 | int t1, t2;
    | ^~
    utelnetd.c: In function 'main':
    utelnetd.c:561:42: warning: pointer targets in passing argument 3 of 'accept' differ in signedness [-Wpointer-sign]
    561 | &salen)) < 0) {
    | ^~~~~~
    | |
    | int *
    In file included from utelnetd.c:45: /usr/include/x86_64-linux-gnu/sys/socket.h:307:42: note: expected 'socklen_t * restrict' {aka 'unsigned int * restrict'} but argument is of type 'int *'
    307 | socklen_t *__restrict __addr_len);
    | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    utelnetd.c:597:60: warning: pointer targets in passing argument 1 of 'remove_iacs' differ in signedness [-Wpointer-sign]
    597 | ptr = remove_iacs(ts->buf1 + ts->wridx1, maxlen,
    | ~~~~~~~~~^~~~~~~~~~~~
    | |
    | char * utelnetd.c:190:28: note: expected 'unsigned char *' but argument is of type 'char *'
    190 | remove_iacs(unsigned char *bf, int len, int *processed, int *num_totty) {
    | ~~~~~~~~~~~~~~~^~
    gcc -I. -pipe -DSHELLPATH=\"/bin/login\" -Wall -fomit-frame-pointer utelnetd.o -o utelnetd
    strip --remove-section=.comment --remove-section=.note utelnetd stappers@paddy:~/src/utelnetd-0.1.11
    $ make
    PROGS: utelnetd
    make: Nothing to be done for 'all'.
    stappers@paddy:~/src/utelnetd-0.1.11
    $ ls -l utelnetd
    -rwxr-xr-x 1 stappers stappers 22984 Nov 10 08:12 utelnetd stappers@paddy:~/src/utelnetd-0.1.11
    $ make clean
    PROGS: utelnetd
    rm -f utelnetd *.o core
    stappers@paddy:~/src/utelnetd-0.1.11
    $ make DEBUG=1
    PROGS: utelnetd
    gcc -I. -pipe -DSHELLPATH=\"/bin/login\" -Wall -DDEBUG -g -Os -c -o utelnetd.o utelnetd.c
    utelnetd.c: In function 'getpty':
    utelnetd.c:232:13: warning: implicit declaration of function 'grantpt'; did you mean 'getpt'? [-Wimplicit-function-declaration]
    232 | if (grantpt(p)<0 || unlockpt(p)<0) {
    | ^~~~~~~
    | getpt
    utelnetd.c:232:29: warning: implicit declaration of function 'unlockpt' [-Wimplicit-function-declaration]
    232 | if (grantpt(p)<0 || unlockpt(p)<0) {
    | ^~~~~~~~
    utelnetd.c:237:44: warning: implicit declaration of function 'ptsname'; did you mean 'ptsname_r'? [-Wimplicit-function-declaration]
    237 | DEBUG_OUT("getpty(): got pty %s\n",ptsname(p));
    | ^~~~~~~
    utelnetd.c:112:40: note: in definition of macro 'DEBUG_OUT'
    112 | #define DEBUG_OUT(...) fprintf(stderr, __VA_ARGS__)
    | ^~~~~~~~~~~
    utelnetd.c:237:19: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat=]
    237 | DEBUG_OUT("getpty(): got pty %s\n",ptsname(p));
    | ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
    | |
    | int
    utelnetd.c:112:40: note: in definition of macro 'DEBUG_OUT'
    112 | #define DEBUG_OUT(...) fprintf(stderr, __VA_ARGS__)
    | ^~~~~~~~~~~
    utelnetd.c:237:39: note: format string is defined here
    237 | DEBUG_OUT("getpty(): got pty %s\n",ptsname(p));
    | ~^
    | |
    | char *
    | %d
    utelnetd.c:238:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    238 | strcpy(line, (const char*)ptsname(p));
    | ^
    utelnetd.c: In function 'main':
    utelnetd.c:561:42: warning: pointer targets in passing argument 3 of 'accept' differ in signedness [-Wpointer-sign]
    561 | &salen)) < 0) {
    | ^~~~~~
    | |
    | int *
    In file included from utelnetd.c:45: /usr/include/x86_64-linux-gnu/sys/socket.h:307:42: note: expected 'socklen_t * restrict' {aka 'unsigned int * restrict'} but argument is of type 'int *'
    307 | socklen_t *__restrict __addr_len);
    | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    utelnetd.c:597:60: warning: pointer targets in passing argument 1 of 'remove_iacs' differ in signedness [-Wpointer-sign]
    597 | ptr = remove_iacs(ts->buf1 + ts->wridx1, maxlen,
    | ~~~~~~~~~^~~~~~~~~~~~
    | |
    | char * utelnetd.c:190:28: note: expected 'unsigned char *' but argument is of type 'char *'
    190 | remove_iacs(unsigned char *bf, int len, int *processed, int *num_totty) {
    | ~~~~~~~~~~~~~~~^~
    gcc -I. -pipe -DSHELLPATH=\"/bin/login\" -Wall -DDEBUG -g -Os utelnetd.o -o utelnetd
    # --remove-section=.comment --remove-section=.note utelnetd stappers@paddy:~/src/utelnetd-0.1.11
    $ make DEBUG=1
    PROGS: utelnetd
    make: Nothing to be done for 'all'.
    stappers@paddy:~/src/utelnetd-0.1.11
    $ ls -l utelnetd
    -rwxr-xr-x 1 stappers stappers 44696 Nov 10 08:12 utelnetd stappers@paddy:~/src/utelnetd-0.1.11
    $
    </screenshot>
    --
    Silence is hard to parse

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)