From f3e1996199869da52384f4c360aa1eecfe4dc1c4 Mon Sep 17 00:00:00 2001
From: Jiri Kubias <jiri.kubias@gmail.com>
Date: Wed, 20 Jan 2010 20:03:22 +0100
Subject: [PATCH] Added conditional compilation of several application

---
 app/arm/armtest_leds/Makefile.omk      |   10 ++++++++++
 app/arm/canldtg/Makefile.omk           |    9 +++++++++
 app/arm/eb_blink/Makefile.omk          |    9 ++++++++-
 app/arm/interrupt_t0_test/Makefile.omk |   11 +++++++++++
 app/arm/minibee/Makefile.omk           |   10 +++++++++-
 app/arm/shodiny/Makefile.omk           |   11 +++++++++++
 app/arm/smotor/Makefile.omk            |   11 ++++++++++-
 app/arm/test_ARMBoard_pwm/Makefile.omk |    9 +++++++++
 app/arm/test_uart/Makefile.omk         |    9 +++++++++
 9 files changed, 86 insertions(+), 3 deletions(-)

diff --git a/app/arm/armtest_leds/Makefile.omk b/app/arm/armtest_leds/Makefile.omk
index 6c49df6..32d892e 100644
--- a/app/arm/armtest_leds/Makefile.omk
+++ b/app/arm/armtest_leds/Makefile.omk
@@ -1,7 +1,17 @@
 # -*- makefile -*-
 
+MY_MACH = lpc21xx
+ifeq ($(MACH), $(MY_MACH))
+
+
 #za bin_programs se dava nazev programu 
 bin_PROGRAMS = armtest_leds			
 
 # za  nazev_programu_SOURCES = se davaji vsechny c zdrojaky, ktere se maji prelozit, oddelovac je mezernik
 armtest_leds_SOURCES = main.c
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my mach - $(MY_MACH). Not going to compile!)
+endif
+endif
\ No newline at end of file
diff --git a/app/arm/canldtg/Makefile.omk b/app/arm/canldtg/Makefile.omk
index 224c712..d4ba6ac 100644
--- a/app/arm/canldtg/Makefile.omk
+++ b/app/arm/canldtg/Makefile.omk
@@ -1,5 +1,8 @@
 # -*- makefile -*-
 
+MY_MACH = lpc21xx
+ifeq ($(MACH), $(MY_MACH))
+
 ifdef ID
 CFLAGS += -DCANLOAD_ID=$(ID)
 endif
@@ -8,3 +11,9 @@ link_VARIANTS = canld
 bin_PROGRAMS = canldtg
 canldtg_LIBS = can
 canldtg_SOURCES = canld_tg.c
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my mach - $(MY_MACH). Not going to compile!)
+endif
+endif
\ No newline at end of file
diff --git a/app/arm/eb_blink/Makefile.omk b/app/arm/eb_blink/Makefile.omk
index c547fc6..145f9bd 100644
--- a/app/arm/eb_blink/Makefile.omk
+++ b/app/arm/eb_blink/Makefile.omk
@@ -1,4 +1,7 @@
 # -*- makefile -*-
+MY_BOARD = lpc21xx
+ifeq ($(BOARD), $(MY_BOARD))
+
 
 # eb_blink je nazev programu, pod timto navzem bude systemem prekladan
 bin_PROGRAMS = eb_blink
@@ -7,4 +10,8 @@ bin_PROGRAMS = eb_blink
 # za nazev_programu_SOURCES se davaji vsechny C zdrojaky, ktere se budou kompilovat
 eb_blink_SOURCES =  main.c
 
-
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my board - $(MY_BOARD). Not going to compile!)
+endif
+endif
diff --git a/app/arm/interrupt_t0_test/Makefile.omk b/app/arm/interrupt_t0_test/Makefile.omk
index b2bb5ae..04b587b 100644
--- a/app/arm/interrupt_t0_test/Makefile.omk
+++ b/app/arm/interrupt_t0_test/Makefile.omk
@@ -1,5 +1,10 @@
 # -*- makefile -*-
 
+MY_MACH = lpc21xx
+ifeq ($(MACH), $(MY_MACH))
+
+
+
 bin_PROGRAMS = interrupt_t0_test
 
 interrupt_t0_test_SOURCES = interrupt_t0_test.c
@@ -7,3 +12,9 @@ interrupt_t0_test_SOURCES = interrupt_t0_test.c
 # Switch off compiler optimization and debug info.
 #OPTIMIZE=
 #DEBUG=
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my mach - $(MY_MACH). Not going to compile!)
+endif
+endif
diff --git a/app/arm/minibee/Makefile.omk b/app/arm/minibee/Makefile.omk
index 9f263ad..507c634 100644
--- a/app/arm/minibee/Makefile.omk
+++ b/app/arm/minibee/Makefile.omk
@@ -1,5 +1,9 @@
 # -*- makefile -*-
 
+MY_BOARD = lpc21xx
+ifeq ($(BOARD), $(MY_BOARD))
+
+
 # eb_blink je nazev programu, pod timto navzem bude systemem prekladan
 bin_PROGRAMS = minibee
 
@@ -10,4 +14,8 @@ minibee_SOURCES =  main.c spi_LPC.c MC1319x.c uart_minibee.c
 
 minibee_LIBS = ebb
 
-
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my board - $(MY_BOARD). Not going to compile!)
+endif
+endif
diff --git a/app/arm/shodiny/Makefile.omk b/app/arm/shodiny/Makefile.omk
index a6c4911..2b21934 100644
--- a/app/arm/shodiny/Makefile.omk
+++ b/app/arm/shodiny/Makefile.omk
@@ -1,6 +1,17 @@
 # -*- makefile -*-
 
+MY_BOARD = spejblarm
+ifeq ($(BOARD), $(MY_BOARD))
+
+
+
 bin_PROGRAMS = shodiny
 shodiny_SOURCES = hodiny.c
 shodiny_LIBS = can
 link_VARIANTS = mpram
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my board - $(MY_BOARD). Not going to compile!)
+endif
+endif
\ No newline at end of file
diff --git a/app/arm/smotor/Makefile.omk b/app/arm/smotor/Makefile.omk
index f8669f4..94cb2f1 100644
--- a/app/arm/smotor/Makefile.omk
+++ b/app/arm/smotor/Makefile.omk
@@ -1,6 +1,15 @@
 # -*- makefile -*-
+MY_BOARD = spejblarm
+ifeq ($(BOARD), $(MY_BOARD))
+
 
 bin_PROGRAMS = smotor
 smotor_SOURCES = motor.c pwm.c
 smotor_LIBS = can
-link_VARIANTS = mpram
\ No newline at end of file
+link_VARIANTS = mpram
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my board - $(MY_BOARD). Not going to compile!)
+endif
+endif
diff --git a/app/arm/test_ARMBoard_pwm/Makefile.omk b/app/arm/test_ARMBoard_pwm/Makefile.omk
index be1655a..6e886ab 100644
--- a/app/arm/test_ARMBoard_pwm/Makefile.omk
+++ b/app/arm/test_ARMBoard_pwm/Makefile.omk
@@ -1,8 +1,17 @@
 # -*- makefile -*-
 
+MY_MACH = lpc21xx
+ifeq ($(MACH), $(MY_MACH))
+
 bin_PROGRAMS = test_ARMBoard_pwm
 
 test_ARMBoard_pwm_SOURCES = test_ARMBoard_pwm.c pwm.c
 #test_LIBS = boot_fn
 
 #link_VARIANTS = boot ram bload flash
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my mach - $(MY_MACH). Not going to compile!)
+endif
+endif
\ No newline at end of file
diff --git a/app/arm/test_uart/Makefile.omk b/app/arm/test_uart/Makefile.omk
index 7069615..e52e6f1 100644
--- a/app/arm/test_uart/Makefile.omk
+++ b/app/arm/test_uart/Makefile.omk
@@ -1,5 +1,8 @@
 # -*- makefile -*-
 
+MY_MACH = lpc21xx
+ifeq ($(MACH), $(MY_MACH))
+
 bin_PROGRAMS = test_uart
 
 test_uart_SOURCES = uart_test.c uartx.c
@@ -7,3 +10,9 @@ test_uart_SOURCES = uart_test.c uartx.c
 # Switch off compiler optimization and debug info.
 #OPTIMIZE=
 #DEBUG=
+
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my mach - $(MY_MACH). Not going to compile!)
+endif
+endif
\ No newline at end of file
-- 
1.6.4.4

