Skip to content

Commit

Permalink
Makefile: Fix static linking (#152)
Browse files Browse the repository at this point in the history
Since libsndfile uses funtions from libm, the -lm should be specified
after libsndfile for static linking.


[Retrieved (and slightly updated) from:
https://git.buildroot.net/buildroot/tree/package/pifmrds/0003-Makefile-fix-static-link.patch]

Signed-off-by: "Eric Limpens" <Limpens@gmail.com>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Co-authored-by: Christophe Jacquet <ChristopheJacquet@users.noreply.github.com>
  • Loading branch information
ffontaine and ChristopheJacquet authored Feb 24, 2024
1 parent 495757f commit 5bb90a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ CFLAGS = $(STD_CFLAGS) $(ARCH_CFLAGS) -DRASPI=$(TARGET)
ifneq ($(TARGET), other)

app: rds.o waveforms.o pi_fm_rds.o rds_strings.o fm_mpx.o control_pipe.o mailbox.o
$(CC) -o pi_fm_rds rds.o rds_strings.o waveforms.o mailbox.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile
$(CC) -o pi_fm_rds rds.o rds_strings.o waveforms.o mailbox.o pi_fm_rds.o fm_mpx.o control_pipe.o -lsndfile -lm

endif


rds_wav: rds.o rds_strings.o waveforms.o rds_wav.o fm_mpx.o
$(CC) -o rds_wav rds_wav.o rds.o rds_strings.o waveforms.o fm_mpx.o -lm -lsndfile
$(CC) -o rds_wav rds_wav.o rds.o rds_strings.o waveforms.o fm_mpx.o -lsndfile -lm

rds_strings.o: rds_strings.c rds_strings.h
$(CC) $(CFLAGS) rds_strings.c
Expand Down

0 comments on commit 5bb90a9

Please sign in to comment.