]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Added conditional compilation of several application
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 20 Jan 2010 14:33:23 +0000 (15:33 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 20 Jan 2010 14:33:23 +0000 (15:33 +0100)
This should prevent compilation errors when compiled for a different board
than was the application designed.

app/arm/addat_base/Makefile.omk
app/arm/eb_ebb/Makefile.omk
app/arm/nazdar2364/Makefile.omk
app/arm/test222/Makefile.omk
app/arm/usbhiddemo/Makefile.omk

index ca9c60cee8a84aaee5580daeb5f177f59bdd6b30..b4869fb8a54ddecdd504d9f029833b9fed4c5219 100644 (file)
@@ -12,6 +12,7 @@ addat_base_SOURCES = main.c pll_init.c   can_btr.c can_btr.c adcan.c uart.c spi_
 link_VARIANTS = flash
 
 else
-    $(warning Not my board - $(MY_BOARD). Not going to compile!)
-
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+    $(error Not my board - $(MY_BOARD). Not going to compile!)
+endif
 endif
index 8a8aa096e1b498e005bd42d935938ea6412debbe..305582e907de089bc962baa4aeb967583061cb9c 100644 (file)
@@ -1,11 +1,11 @@
 # -*- makefile -*-
 
 MY_BOARD = lpceurobot
-ifeq ($(BOARD), $(MY_BOARD)) 
+ifeq ($(BOARD), $(MY_BOARD))
 
        bin_PROGRAMS = eb_ebb
 
-       eb_ebb_SOURCES = main.c 
+       eb_ebb_SOURCES = main.c
        eb_ebb_LIBS = can ebb
 
 
@@ -17,6 +17,7 @@ ifeq ($(BOARD), $(MY_BOARD))
        link_VARIANTS = flash
 
 else
-    $(warning Not my board - $(MY_BOARD). Not going to compile!)
-
-endif
\ No newline at end of file
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+$(error Not my board - $(MY_BOARD). Not going to compile!)
+endif
+endif
index d200df7202a31c3c4ddd909f905b3e48078085ad..4538b78ea01b02d349f0045dc186b257eac73338 100644 (file)
@@ -1,8 +1,14 @@
 # -*- makefile -*-
 
+ifeq ($(MACH),lpc23xx)
 bin_PROGRAMS = nazdar2364
 
 nazdar2364_SOURCES = nazdar2364.c
 nazdar2364_LIBS = pwm pll uart_zen
 
 link_VARIANTS = ram
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+    $(error This works only with LPC23xx machnies!)
+endif
+endif
index 91548da599a9ebd8ec5610f26381889823f8651a..85c963d43e06beec778417c5b1a8a73e86791058 100644 (file)
@@ -1,6 +1,11 @@
 # -*- makefile -*-
 
+ifeq ($(MACH),lpc23xx)
 bin_PROGRAMS = test22
 
 test22_SOURCES = main.c pll_init.c lpcan.h can_btr.c
-
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+    $(error This works only with LPC23xx machnies!)
+endif
+endif
index f2768a76e8728aa8c472b4dc804689db446c043d..e5e6b017cee9c397bb1e773eba85a996000a5d9c 100644 (file)
@@ -1,5 +1,6 @@
 # -*- makefile -*-
 
+ifeq ($(CONFIG_USB_LPCUSB),y)
 INCLUDES += -I.
 
 bin_PROGRAMS = usbhid
@@ -9,3 +10,8 @@ lib_LOADLIBES = usbbase usbmore lpcusb pll
 nobase_include_HEADERS = usb/usb_defs.h
 
 link_VARIANTS = flash
+else
+ifeq ($(RELATIVE_DIR),$(INVOCATION_DIR))
+    $(error CONFIG_USB_LPCUSB is not set to 'y'!)
+endif
+endif