From cd4afbb8595770d6058f0bcc7b5953946d5e87c4 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 4 May 2025 18:58:30 -0700 Subject: Maybe more correct On raspberry pi debian 12, when trying to build https://codeberg.org/flyxyz123/remote_plot, I got make error "ld: undefined reference to ..." if use `cc -Wall $$(pkg-config --cflags --libs libssh plplot gtk4) -lm -o $@ $^`. No error if move $^ to the beginning. Not sure why, maybe becuase pi has an old version of gcc? This repo does not have this issue if put `$^` at the end. But I think put `$^` at the beginning maybe is a more correct way. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f7ea5d5..0a7ee26 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ mycan.o: mycan.c mycan: all_SRE_edited.o mycan.o # $^ expand to all, $< expand to first # see `info make` section "10.5.3 Automatic Variables" - cc -Wall -o $@ $^ + cc $^ -Wall -o $@ clean: rm -f mycan all_SRE_edited.o mycan.o -- cgit v1.2.3-70-g09d2