From d1d923cefebf734557505f420f2f99bb3cfd5319 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 20 Jan 2010 15:33:23 +0100 Subject: [PATCH] Added conditional compilation of several application This should prevent compilation errors when compiled for a different board than was the application designed. --- app/arm/addat_base/Makefile.omk | 5 +++-- app/arm/eb_ebb/Makefile.omk | 11 ++++++----- app/arm/nazdar2364/Makefile.omk | 6 ++++++ app/arm/test222/Makefile.omk | 7 ++++++- app/arm/usbhiddemo/Makefile.omk | 6 ++++++ 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/arm/addat_base/Makefile.omk b/app/arm/addat_base/Makefile.omk index ca9c60c..b4869fb 100644 --- a/app/arm/addat_base/Makefile.omk +++ b/app/arm/addat_base/Makefile.omk @@ -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 diff --git a/app/arm/eb_ebb/Makefile.omk b/app/arm/eb_ebb/Makefile.omk index 8a8aa09..305582e 100644 --- a/app/arm/eb_ebb/Makefile.omk +++ b/app/arm/eb_ebb/Makefile.omk @@ -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 diff --git a/app/arm/nazdar2364/Makefile.omk b/app/arm/nazdar2364/Makefile.omk index d200df7..4538b78 100644 --- a/app/arm/nazdar2364/Makefile.omk +++ b/app/arm/nazdar2364/Makefile.omk @@ -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 diff --git a/app/arm/test222/Makefile.omk b/app/arm/test222/Makefile.omk index 91548da..85c963d 100644 --- a/app/arm/test222/Makefile.omk +++ b/app/arm/test222/Makefile.omk @@ -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 diff --git a/app/arm/usbhiddemo/Makefile.omk b/app/arm/usbhiddemo/Makefile.omk index f2768a7..e5e6b01 100644 --- a/app/arm/usbhiddemo/Makefile.omk +++ b/app/arm/usbhiddemo/Makefile.omk @@ -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 -- 2.39.2