aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-05-04 18:58:30 -0700
committerXiao Pan <xyz@flylightning.xyz>2025-05-04 18:58:30 -0700
commitcd4afbb8595770d6058f0bcc7b5953946d5e87c4 (patch)
treeb5b942153fd1ee6f1027acba3ff3fdaab23d1411
parenta879c97a5dbb9f29f7637509d4a02397478c8160 (diff)
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.
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
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