@@ -14,7 +14,7 @@ OBJS_EXTRA :=
14
14
# command line option
15
15
OPTS :=
16
16
17
- LDFLAGS := -lm
17
+ LDFLAGS :=
18
18
19
19
# virtio-blk
20
20
ENABLE_VIRTIOBLK ?= 1
@@ -71,27 +71,26 @@ ifeq ($(call has, VIRTIOSND), 1)
71
71
OBJS_EXTRA += virtio-snd.o
72
72
73
73
PORTAUDIOLIB := portaudio/lib/.libs/libportaudio.a
74
- LDFLAGS += -lasound -lpthread $(PORTAUDIOLIB ) -lm -lrt -lpulse
75
- CFLAGS += -Icnfa -Iportaudio/include
76
-
77
- cnfa/Makefile :
78
- git submodule update --init cnfa
79
- cnfa/os_generic : cnfa/Makefile
80
- $(MAKE ) -C $(dir $< ) os_generic.h
81
- CNFA_LIB := cnfa/CNFA_sf.h
82
- $(CNFA_LIB ) : cnfa/Makefile cnfa/os_generic
83
- $(MAKE ) -C $(dir $< ) CNFA_sf.h
74
+ # PortAudio requires libm, yet we set -lm in the end of LDFLAGS
75
+ # so that the other libraries will be benefited for no need to set
76
+ # -lm separately.
77
+ LDFLAGS += $(PORTAUDIOLIB ) -lasound -lpthread -lrt -lpulse
78
+ CFLAGS += -Iportaudio/include
79
+
84
80
portaudio/Makefile :
85
81
git submodule update --init portaudio
86
82
$(PORTAUDIOLIB ) : portaudio/Makefile
87
83
@cd $(dir $< ) && ./configure
88
84
@cd $(dir $< ) && $(MAKE )
89
- main.o : $(CNFA_LIB ) $( PORTAUDIOLIB )
85
+ main.o : $(PORTAUDIOLIB )
90
86
91
- # suppress warning when compiling CNFA
92
- virtio-snd.o : CFLAGS += -Wno-unused-parameter -Wno-sign-compare
87
+ # suppress warning when compiling PortAudio
88
+ virtio-snd.o : CFLAGS += -Wno-unused-parameter
93
89
endif
94
90
91
+ # Set libm as the last dependency so that no need to set -lm seperately.
92
+ LDFLAGS += -lm
93
+
95
94
# .DEFAULT_GOAL should be set to all since the very first target is not all
96
95
# after git submodule.
97
96
.DEFAULT_GOAL := all
0 commit comments