Move $(LIBS) to end of compile command
Without this change, when I run `make` it fails with this error (edited
ld: frontend/readline.o: in function `sigint_handler':
mrsh/frontend/readline.c:33: undefined reference to `rl_on_new_line'
ld: mrsh/frontend/readline.c:34: undefined reference to `rl_replace_line'
ld: mrsh/frontend/readline.c:35: undefined reference to `rl_redisplay'
ld: frontend/readline.o: in function `interactive_init':
ld: mrsh/frontend/readline.c:53: undefined reference to `read_history'
ld: frontend/readline.o: in function `interactive_next':
ld: mrsh/frontend/readline.c:74: undefined reference to `add_history'
ld: mrsh/frontend/readline.c:76: undefined reference to `write_history'
collect2: error: ld returned 1 exit status
make: *** [Makefile:61: mrsh] Error 1
It turns out that the placement of `-l` in the command is significant
; it should come after the object files that depend on the library.
> It makes a difference where in the command you write this option; the
> linker searches and processes libraries and object files in the order
> they are specified. Thus, ‘foo.o -lz bar.o’ searches library ‘z’ after
> file foo.o but before bar.o. If bar.o refers to functions in ‘z’,
> those functions may not be loaded.
Moving $(LIBS) to the end of the command (right next to -lmrsh) fixes
Tested using gcc 12.2.0 and clang 15.0.0