Created
May 26, 2015 11:28
-
-
Save apieum/265e3a4e1a2518a6290b to your computer and use it in GitHub Desktop.
jamfile et jamrule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SubDir TOP ; | |
LOCATE_TARGET = $(TOP)/../build/tests ; | |
LOCATE_SOURCE = $(TOP)/../build/tests ; | |
SEARCH_SOURCE = $(PWD:D) ; | |
LIBS = ; | |
HDRS += $(LIBRARY_DIR)/$(LIBS) ; | |
LIBRARY_MODULES = [ GLOB $(LIBRARY_DIR)/$(LIBS) : *.cpp *.c ] ; | |
Main $(SEARCH_SOURCE:B) : $(ARDUINOUNIT_MODULES) $(SRC_MODULES) $(SKETCH_MODULES) $(LIBRARY_MODULES) $(CORE_MODULES) $(INTERNAL_MODULES) [ GLOB $(SEARCH_SOURCE) : *.ino *.cpp ] $(EXTRAS_DIR)/runner.cpp [ GLOB $(PWD) : *.ino *.cpp ] ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CORE_DIR = $(HOME)/workspace/ncore/src ; | |
ARDUINO_DIR = /usr/share/arduino ; | |
INTERNAL_DIR = $(CORE_DIR)/internal ; | |
EXTRAS_DIR = $(CORE_DIR)/extras ; | |
LIBRARY_DIR = $(ARDUINO_DIR)/libraries ; | |
SRC_DIR = $(TOP)/../src ; | |
ARDUINOUNIT_DIR = $(EXTRAS_DIR)/arduinounit ; | |
HDRS += $(CORE_DIR) $(INTERNAL_DIR) $(SRC_DIR) ; | |
DEFINES += NATIVE=1 ARDUINO=100 ; | |
CORE_MODULES = [ GLOB $(CORE_DIR) : *.cpp ] ; | |
INTERNAL_MODULES = [ GLOB $(INTERNAL_DIR) : *.cpp ] ; | |
ARDUINOUNIT_MODULES = [ GLOB $(ARDUINOUNIT_DIR) : *.cpp ] ; | |
SRC_MODULES = [ GLOB $(SRC_DIR) : *.cpp ] ; | |
LINK = c++ ; | |
C++ = c++ ; | |
LOCATE_TARGET = $(TOP)/../build/tests ; | |
LOCATE_SOURCE = $(TOP)/../build/tests ; | |
CCFLAGS = -fprofile-arcs -ftest-coverage -g -O0 -fno-inline -Wall -Wextra -I$(ARDUINOUNIT_DIR) ; | |
C++FLAGS = $(CCFLAGS) ; | |
LINKFLAGS = -fprofile-arcs -Wl,--no-as-needed -lpthread -lreadline -L$(CORE_DIR) -L$(INTERNAL_DIR) -L$(ARDUINOUNIT_DIR) ; | |
if ( $(OS) = MACOSX ) | |
{ | |
HDRS += /Developer/SDKs/MacOSX10.6.sdk/usr/include ; | |
DEFINES += MAC=1 ; | |
} | |
else | |
{ | |
LINKFLAGS += -lrt ; | |
C++FLAGS += -std=gnu++11 ; | |
} | |
rule Ino | |
{ | |
Depends $(<) : $(>) ; | |
MakeLocate $(<) : $(LOCATE_SOURCE) ; | |
Clean clean : $(<) ; | |
} | |
actions Ino | |
{ | |
echo "#include <Arduino.h>" > $(<) | |
echo "#line 1 \"$(>)\"" >> $(<) | |
cat $(>) >> $(<) | |
} | |
rule C++Ino | |
{ | |
local _CPP = $(>:B).cpp ; | |
Ino $(_CPP) : $(>) ; | |
C++ $(<) : $(_CPP) ; | |
} | |
rule UserObject | |
{ | |
switch $(>:S) | |
{ | |
case .ino : C++Ino $(<) : $(>) ; | |
case .pde : C++Ino $(<) : $(>) ; | |
} | |
} | |
rule Objects | |
{ | |
local _i ; | |
for _i in [ FGristFiles $(<) ] | |
{ | |
local _b = $(_i:B)$(SUFOBJ) ; | |
local _o = $(_b:G=$(SOURCE_GRIST:E)) ; | |
Object $(_o) : $(_i) ; | |
Depends obj : $(_o) ; | |
} | |
} | |
rule Main | |
{ | |
MainFromObjects $(<) : $(>:B)$(SUFOBJ) ; | |
Objects $(>) ; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment