From ad8aa22f834fb04529152e6630c5e6c30cfb40f5 Mon Sep 17 00:00:00 2001 From: Will Olner Date: Wed, 4 Feb 2015 16:40:36 +0000 Subject: [PATCH 1/6] updated makefile with install option --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 17cd20e..60928af 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ INCLUDES = \ -I$(DIR)/libraries \ -I$(DIR)/libraries/SPI \ -I$(DIR)/libraries/Wire \ - -I$(DIR)/libraries/PN532_SPI + -I$(DIR)/libraries/PN532_SPI CFLAGS = -fPIC #CFLAGS = $(INCLUDES) @@ -49,11 +49,11 @@ SRCS = \ OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRCS))) %.o: %.cpp - @rm -f $@ + @rm -f $@ $(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations %.o: %.c - @rm -f $@ + @rm -f $@ $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations LIB_STATIC = libarduino.a @@ -71,4 +71,8 @@ $(LIB): $(OBJS) clean: rm -f $(LIB_STATIC) $(LIB_SHARE) $(OBJS) - +install: + cp -rf $(DIR)/$(LIB_STATIC) /usr/local/lib/ + cp -rf $(DIR)/hardware /usr/local/include/ + cp -rf $(DIR)/libraries /usr/local/include/ + cp -rf $(DIR)/sample/core.h /usr/local/include/ From 94e6576118bafb79182dcce5ba43c780422a7ae7 Mon Sep 17 00:00:00 2001 From: Will Olner Date: Wed, 4 Feb 2015 16:42:52 +0000 Subject: [PATCH 2/6] added readme --- README | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..79a498d --- /dev/null +++ b/README @@ -0,0 +1,6 @@ +Installation instructions: + +"$ make" +"$ sudo make install" + + From 9e4be9860553cdc49281312cd7ae50a4f434b5c0 Mon Sep 17 00:00:00 2001 From: Will Olner Date: Wed, 4 Feb 2015 16:57:24 +0000 Subject: [PATCH 3/6] copying shared library too --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 60928af..cec02b5 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,7 @@ clean: install: cp -rf $(DIR)/$(LIB_STATIC) /usr/local/lib/ + cp -rf $(DIR)/$(LIB_SHARE) /usr/local/lib/ cp -rf $(DIR)/hardware /usr/local/include/ cp -rf $(DIR)/libraries /usr/local/include/ cp -rf $(DIR)/sample/core.h /usr/local/include/ From 56a4d359fde5f09bb5e05975208d3a9fa1f189bd Mon Sep 17 00:00:00 2001 From: Will Olner Date: Wed, 4 Feb 2015 17:03:33 +0000 Subject: [PATCH 4/6] Added NOSAMPLES flag --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cec02b5..7e2921d 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,13 @@ LIB_SHARE = libarduino.so LIB = $(LIB_STATIC) $(LIB_SHARE) all: $(LIB) - make -C sample/ + + ifneq (,$(findstring NOSAMPLES,$(MAKEFLAGS))) + make -C sample/ + else + + endif + $(LIB): $(OBJS) From 655e6b41c61ee3e6c9e117121be513543dfea73f Mon Sep 17 00:00:00 2001 From: willoftw Date: Thu, 5 Feb 2015 10:32:43 +0000 Subject: [PATCH 5/6] Updated README, removed NOSAMPLES flag, added samples make option, now not built by default --- Makefile | 28 ++++++++++++---------------- README | 5 ++--- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 7e2921d..3e0576a 100644 --- a/Makefile +++ b/Makefile @@ -62,24 +62,20 @@ LIB = $(LIB_STATIC) $(LIB_SHARE) all: $(LIB) - ifneq (,$(findstring NOSAMPLES,$(MAKEFLAGS))) - make -C sample/ - else - - endif - - - $(LIB): $(OBJS) - $(AR) cq $(LIB_STATIC) $(OBJS) - $(CXX) -shared -Wl,-soname,$(LIB_SHARE) -o $(LIB_SHARE) $(OBJS) + $(AR) cq $(LIB_STATIC) $(OBJS) + $(CXX) -shared -Wl,-soname,$(LIB_SHARE) -o $(LIB_SHARE) $(OBJS) clean: - rm -f $(LIB_STATIC) $(LIB_SHARE) $(OBJS) + rm -f $(LIB_STATIC) $(LIB_SHARE) $(OBJS) install: - cp -rf $(DIR)/$(LIB_STATIC) /usr/local/lib/ - cp -rf $(DIR)/$(LIB_SHARE) /usr/local/lib/ - cp -rf $(DIR)/hardware /usr/local/include/ - cp -rf $(DIR)/libraries /usr/local/include/ - cp -rf $(DIR)/sample/core.h /usr/local/include/ + cp -rf $(DIR)/$(LIB_STATIC) /usr/local/lib/ + cp -rf $(DIR)/$(LIB_SHARE) /usr/local/lib/ + cp -rf $(DIR)/hardware /usr/local/include/ + cp -rf $(DIR)/libraries /usr/local/include/ + cp -rf $(DIR)/sample/core.h /usr/local/include/ + +samples: + make -C sample/ + diff --git a/README b/README index 79a498d..5051431 100644 --- a/README +++ b/README @@ -1,6 +1,5 @@ Installation instructions: -"$ make" -"$ sudo make install" - +Run "$ make" first then if you want to build the examples run +"$ make samples". Finally run "$ sudo make install" to copy headers and libraries to your pcduino From 370376b20312a321d11bd39c37ff5bee5a32b496 Mon Sep 17 00:00:00 2001 From: willoftw Date: Thu, 5 Feb 2015 12:46:37 +0000 Subject: [PATCH 6/6] fixed tab issues in Makefile --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 3e0576a..79893d7 100644 --- a/Makefile +++ b/Makefile @@ -63,19 +63,19 @@ LIB = $(LIB_STATIC) $(LIB_SHARE) all: $(LIB) $(LIB): $(OBJS) - $(AR) cq $(LIB_STATIC) $(OBJS) - $(CXX) -shared -Wl,-soname,$(LIB_SHARE) -o $(LIB_SHARE) $(OBJS) + $(AR) cq $(LIB_STATIC) $(OBJS) + $(CXX) -shared -Wl,-soname,$(LIB_SHARE) -o $(LIB_SHARE) $(OBJS) clean: - rm -f $(LIB_STATIC) $(LIB_SHARE) $(OBJS) + rm -f $(LIB_STATIC) $(LIB_SHARE) $(OBJS) install: - cp -rf $(DIR)/$(LIB_STATIC) /usr/local/lib/ - cp -rf $(DIR)/$(LIB_SHARE) /usr/local/lib/ - cp -rf $(DIR)/hardware /usr/local/include/ - cp -rf $(DIR)/libraries /usr/local/include/ - cp -rf $(DIR)/sample/core.h /usr/local/include/ + cp -rf $(DIR)/$(LIB_STATIC) /usr/local/lib/ + cp -rf $(DIR)/$(LIB_SHARE) /usr/local/lib/ + cp -rf $(DIR)/hardware /usr/local/include/ + cp -rf $(DIR)/libraries /usr/local/include/ + cp -rf $(DIR)/sample/core.h /usr/local/include/ samples: - make -C sample/ + make -C sample/