From e361b1654fefd1a563a82d335795f94b794b4873 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Tue, 20 Nov 2018 14:06:54 +0800 Subject: [PATCH] move configure parser source code to etc folder, and set default log file to /tmp --- src/nbiotd/makefile | 41 ++++++++++++++--------------------------- 1 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/nbiotd/makefile b/src/nbiotd/makefile index d570f3c..e6ded50 100644 --- a/src/nbiotd/makefile +++ b/src/nbiotd/makefile @@ -1,5 +1,5 @@ #********************************************************************************* -# Copyright: (C) 2012 CoherentPlus Sdn. Bhd. +# Copyright: (C) 2018 LingYun IoT Studio # All rights reserved. # # Filename: Makefile @@ -7,9 +7,9 @@ # Cross compile the subdir source code and link all the libs to # excutable binary file. # -# Version: 1.0.0(10/08/2011~) +# Version: 1.0.0 # Author: Guo Wenxue <guowenxue@gmail.com> -# ChangeLog: 1, Release initial version on "10/08/2011 01:29:33 AM" +# ChangeLog: 1, Release initial version on "2018/11/20 11:29:33 AM" # #********************************************************************************/ @@ -19,8 +19,8 @@ LIBS_PATH=${TOP_PATH}/.libs #Excutable binary file runs on platform -ARCH?=arm -#ARCH?=i386 +#ARCH?=arm +ARCH?=x86 #Static linked or Dynamic link LINK_MODE=STATIC @@ -37,14 +37,19 @@ # ================================== # ** Cross Compiler Setting ** # ================================== - +# +ifeq ("${ARCH}", "x86") +export CROSS_COMPILE= +else export CROSS_COMPILE=/opt/rpi/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf- +endif + # Get alll the source code folder, all the source code in the subdir will be compiled and # archive to a static library, named lib${subdir_name}.a OBJFILES = $(patsubst %.c,%,$(wildcard *.c)) SUBSRCS = $(shell find . -follow -maxdepth 1 -type d|sed -n 's/.\///p'|grep -v 'libs' \ - |grep -v 'etc' | grep -v '.svn'|grep -v '.git'|grep -v 'include'|grep -v 'bin') + | grep -v '.svn'|grep -v '.git'|grep -v 'include'|grep -v 'bin') # Add the subdir compiled static library into LDFLAGS #LDFLAGS+=$(patsubst %,-L%,$(SUBSRCS)) @@ -81,7 +86,7 @@ MakeSubDir; \ if [ -f makefile -o -f Makefile ]; then \ pwd; \ - make $(1); \ + make $(1) CROSS_COMPILE=${CROSS_COMPILE}; \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ @@ -102,7 +107,7 @@ .PHONY: all -all: entry version prepare binary install +all: entry prepare binary install prepare: @if [ ! -L cp_library ] ; then \ @@ -117,23 +122,6 @@ @echo " ========================================================="; @echo " "; @make clean - -version: - @echo "/* Generated by makefile, don't Edit it by hand */" > version.h - @echo '#define DATE "$(COMPILE_DATE)"' >> version.h - @echo "#define MAJOR 1" >>version.h - @echo "#define MINOR 0" >>version.h - @echo "#define REVER 0" >>version.h - @if [ -f .svn/entries ] ; then \ - echo "#define SVNVER `sed -n -e 4p .svn/entries`" >>version.h; \ - else \ - echo "#define SVNVER 0" >>version.h; \ - fi; - @echo "" >> version.h - @echo '#define version(progname) printf("%s Version %d.%d.%d Build @%05d (%s)\\n", progname, MAJOR, MINOR, REVER,SVNVER, DATE)' >> version.h - @echo '#define copyright() printf("Copyright (C) 2012 CoherentPlus Sdn. Bhd.\\n")' >>version.h - @echo '#define banner(progname) {version(progname); copyright(); printf("\\n");}' >>version.h - @echo "" >> version.h subdir: @$(call LOOPMAKEFUNC,all) @@ -162,7 +150,6 @@ clean: @$(call LOOPMAKEFUNC,clean) @rm -rf ${LIBS_PATH} - @rm -f version.h @rm -f *.o $(APP_BINARY_NAME) @rm -f *.elf* @rm -f *.gdb -- Gitblit v1.9.1