From 3f507e3116fe374e2ce2e670acc0c9d95dcff4ff Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Tue, 12 Mar 2019 11:57:01 +0100 Subject: [PATCH] can: fix Makefile to attend the different targets General Makefile calls each API source without any specific target, this commit fixes the CAN Makefile to build without errors. Signed-off-by: Arturo Buzarra --- apix-can-examples/Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apix-can-examples/Makefile b/apix-can-examples/Makefile index 677aa10..4a7d4fe 100644 --- a/apix-can-examples/Makefile +++ b/apix-can-examples/Makefile @@ -13,7 +13,6 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # -all: BINARYTX BINARYRX BINARYTX := apix-can-send-example BINARYRX := apix-can-recv-example @@ -25,10 +24,13 @@ CFLAGS += -Wall -O0 CFLAGS += $(shell pkg-config --cflags libdigiapix) LDLIBS += $(shell pkg-config --libs libdigiapix) -BINARYTX: can-send-example.o +.PHONY: all +all: $(BINARIES) + +$(BINARYTX): can-send-example.o $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $(BINARYTX) -BINARYRX: can-recv-example.o +$(BINARYRX): can-recv-example.o $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $(BINARYRX) .PHONY: install @@ -36,9 +38,6 @@ install: $(BINARIES) install -d $(DESTDIR)/usr/bin install -m 0755 $^ $(DESTDIR)/usr/bin/ -.PHONY: all -all: $(BINARYTX) $(BINARYRX) - .PHONY: clean clean: - -rm -f *.o $(BINARYTX) $(BINARYRX) + -rm -f *.o $(BINARIES)