[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2622-g5dbcb0f
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2011-12-07 15:22:41
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 5dbcb0f3c41d8384f323fff845a326eb7b8ec7d2 (commit)
via c4701889f8df07b9d9da6a8be2a367b66fd04c86 (commit)
from 845f1efd1b3466330ab97be2c4a7bdf293739fa4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5dbcb0f3c41d8384f323fff845a326eb7b8ec7d2
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 7 16:20:53 2011 +0100
[AS_DEVICES] Cleanup cpp build
commit c4701889f8df07b9d9da6a8be2a367b66fd04c86
Author: Julien Boibessot <jul...@ar...>
Date: Wed Dec 7 16:04:15 2011 +0100
[DEMOS] Cleanup toggle_gpio
-----------------------------------------------------------------------
Summary of changes:
target/demos/toggle_gpio/Makefile | 26 ++++++++++++++++++++------
target/demos/toggle_gpio/toggle_gpio.c | 12 +++++++-----
target/packages/as_devices/Makefile | 5 +++--
target/packages/as_devices/cpp/Makefile | 10 ++++------
4 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/target/demos/toggle_gpio/Makefile b/target/demos/toggle_gpio/Makefile
index fa33b98..c869b07 100644
--- a/target/demos/toggle_gpio/Makefile
+++ b/target/demos/toggle_gpio/Makefile
@@ -1,7 +1,21 @@
-HOST=../../../buildroot/output/host/
-STAGING_DIR=../../../buildroot/output/staging/
-CC=$(HOST)/usr/bin/arm-linux-gcc
-INCLUDE=-I$(STAGING_DIR)/usr/include/as_devices/
+HOST_DIR = ../../../buildroot/output/host/
+STAGING_DIR = ../../../buildroot/output/staging/
+TARGET_DIR = ../../../buildroot/output/target/
-toggle_gpio: toggle_gpio.c
- $(CC) -Wall toggle_gpio.c -o toggle_gpio -las_devices $(INCLUDE)
+CC = $(HOST_DIR)/usr/bin/arm-linux-gcc
+CFLAGS = -Wall
+INCLUDE = -I$(STAGING_DIR)/usr/include/as_devices/
+INSTALL_DIR = $(TARGET_DIR)/usr/bin/
+
+EXEC = toggle_gpio
+
+$(EXEC): toggle_gpio.c
+ $(CC) $(CFLAGS) toggle_gpio.c -o $(EXEC) -las_devices $(INCLUDE)
+
+install: $(EXEC)
+ cp -f $(EXEC) $(INSTALL_DIR)
+
+clean:
+ rm -f *.o $(EXEC)
+
+.PHONY: install clean
diff --git a/target/demos/toggle_gpio/toggle_gpio.c b/target/demos/toggle_gpio/toggle_gpio.c
index 00d6d3a..8d20a2e 100644
--- a/target/demos/toggle_gpio/toggle_gpio.c
+++ b/target/demos/toggle_gpio/toggle_gpio.c
@@ -2,20 +2,22 @@
#include <stdlib.h>
#include <as_gpio.h>
+#define LED_GPIO 174 /* for APF27Dev */
+/* #define LED_GPIO 2 for APF51Dev */
+
int main(int argc, char *argv[])
{
struct as_gpio_device *led;
- led = as_gpio_open(174); //For apf27Dev */
- /* led = as_gpio_open(2); //For apf51Dev */
- if (led == NULL){
+ led = as_gpio_open(LED_GPIO);
+ if (led == NULL) {
printf("Error: can't open gpio\n");
- return -1;
+ exit(1);
}
as_gpio_set_pin_direction(led, "out");
- while(1){
+ while (1) {
as_gpio_set_pin_value(led, 0);
as_gpio_set_pin_value(led, 1);
}
diff --git a/target/packages/as_devices/Makefile b/target/packages/as_devices/Makefile
index f2de2ec..d014f88 100644
--- a/target/packages/as_devices/Makefile
+++ b/target/packages/as_devices/Makefile
@@ -22,7 +22,7 @@ CPP_LIB=cpp/$(CPP_LIBNAME)
CPP_INCLUDE=cpp
-.PHONY: all
+.PHONY: all install install-exe clean
all: $(C_BINARY) $(P_WRAPPER)
#$(CPP_BINARY)
@@ -34,7 +34,7 @@ $(CPP_BINARY): main.c test_cpp.h $(CPP_LIB) $(C_LIB)
$(CXX) $(CFLAGS) main.c $(C_LIB) $(CPP_LIB) -I$(C_INCLUDE) -I$(CPP_INCLUDE) -o $(CPP_BINARY) -D__cplusplus
$(CPP_LIB): $(C_LIB)
- cd cpp; make CXX=$(CXX)
+ make -C cpp/
$(C_LIB):
make -C c/
@@ -54,6 +54,7 @@ install-exe:
clean:
make -C c/ clean
+ make -C cpp/ clean
rm -f $(P_WRAPPER)
make -C python/ clean
rm -f $(C_BINARY) # $(CPP_BINARY)
diff --git a/target/packages/as_devices/cpp/Makefile b/target/packages/as_devices/cpp/Makefile
index 4f88be7..23439da 100644
--- a/target/packages/as_devices/cpp/Makefile
+++ b/target/packages/as_devices/cpp/Makefile
@@ -4,8 +4,8 @@
# Default values for local compiling:
ARMADEUS_BASE_DIR=../../../../
-include $(ARMADEUS_BASE_DIR)/Makefile.in
-CXXFLAGS=-Wall -g -O0
-LDFLAGS=
+CXX = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
+CXXFLAGS =-Wall -g -O0
OBJS = as_i2c.o
OBJS += as_gpio.o
@@ -36,7 +36,5 @@ ${STAT_LIB}: ${OBJS}
$(CXX) -fPIC -o $@ -c $< ${CXXFLAGS} -I${C_INCLUDE} -D__cplusplus
clean:
- -rm ${OBJ} ${BINARY} ${STAT_LIB} ${LIBNAME}
- -rm *.o
- -rm *.so
-
+ rm -f *.o *.so
+ rm -f ${BINARY} ${STAT_LIB} ${LIBNAME}
hooks/post-receive
--
armadeus
|