Factored out setup directory search path for source files into Makefile.include.
- Search target specific directories before CPU specific directories. - Search CPU specific directories before generic directories. Note: I checked several builds but nevertheless one or the other might need some additional adjustsments. Sorry for the inconvenience.
This commit is contained in:
parent
4832e803e8
commit
237b1617b5
|
@ -70,8 +70,22 @@ ifdef APPS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### Include target makefile (TODO Unsafe?)
|
### Include target makefile (TODO Unsafe?)
|
||||||
|
|
||||||
include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)
|
include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)
|
||||||
|
|
||||||
|
### Setup directory search path for source files
|
||||||
|
|
||||||
|
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
||||||
|
$(CONTIKI_TARGET_DIRS)}
|
||||||
|
CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI_CPU)/, \
|
||||||
|
$(CONTIKI_CPU_DIRS)}
|
||||||
|
|
||||||
|
SOURCEDIRS = $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
||||||
|
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(APPDIRS)
|
||||||
|
|
||||||
|
vpath %.c $(SOURCEDIRS)
|
||||||
|
vpath %.S $(SOURCEDIRS)
|
||||||
|
|
||||||
### Automatic dependency generation
|
### Automatic dependency generation
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
@ -79,7 +93,6 @@ ifneq ($(MAKECMDGOALS),clean)
|
||||||
$(PROJECT_SOURCEFILES:.c=.d)}
|
$(PROJECT_SOURCEFILES:.c=.d)}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ *core core *.srec \
|
rm -f *~ *core core *.srec \
|
||||||
*.lst *.map \
|
*.lst *.map \
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#
|
#
|
||||||
# Author: Oliver Schmidt <ol.sc@web.de>
|
# Author: Oliver Schmidt <ol.sc@web.de>
|
||||||
#
|
#
|
||||||
# $Id: Makefile.6502,v 1.7 2007/04/21 22:15:45 oliverschmidt Exp $
|
# $Id: Makefile.6502,v 1.8 2007/05/13 08:41:32 oliverschmidt Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ifndef CONTIKI
|
ifndef CONTIKI
|
||||||
|
@ -96,16 +96,3 @@ CUSTOM_RULE_C_TO_CO = 1
|
||||||
|
|
||||||
$(OBJECTDIR)/%.o: %.S
|
$(OBJECTDIR)/%.o: %.S
|
||||||
$(AS) $(AFLAGS) $< -o $@
|
$(AS) $(AFLAGS) $< -o $@
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI)/cpu/6502/, \
|
|
||||||
$(CONTIKI_CPU_DIRS)}
|
|
||||||
SOURCEDIRS = $(PROJECTDIRS) \
|
|
||||||
$(CONTIKI_TARGET_DIRS_CONCAT) $(CONTIKI_CPU_DIRS_CONCAT) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(APP_DIRS)
|
|
||||||
|
|
||||||
vpath %.c $(SOURCEDIRS)
|
|
||||||
vpath %.S $(SOURCEDIRS)
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile.msp430,v 1.15 2007/04/03 19:05:13 adamdunkels Exp $
|
# $Id: Makefile.msp430,v 1.16 2007/05/13 08:41:49 oliverschmidt Exp $
|
||||||
|
|
||||||
ifdef nodeid
|
ifdef nodeid
|
||||||
CFLAGS += -DNODEID=$(nodeid)
|
CFLAGS += -DNODEID=$(nodeid)
|
||||||
|
@ -11,6 +11,8 @@ CONTIKI_CPU=$(CONTIKI)/cpu/msp430
|
||||||
|
|
||||||
### Define the source files we have in the MSP430 port
|
### Define the source files we have in the MSP430 port
|
||||||
|
|
||||||
|
CONTIKI_CPU_DIRS = . dev
|
||||||
|
|
||||||
MSP430 = msp430.c flash.c clock.c leds.c leds-arch.c \
|
MSP430 = msp430.c flash.c clock.c leds.c leds-arch.c \
|
||||||
watchdog.c lpm.c mtarch.c uart1.c rtimer-arch.c
|
watchdog.c lpm.c mtarch.c uart1.c rtimer-arch.c
|
||||||
UIPDRIVERS = me.c me_tabs.c slip.c crc16.c
|
UIPDRIVERS = me.c me_tabs.c slip.c crc16.c
|
||||||
|
@ -47,18 +49,8 @@ LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
|
||||||
|
|
||||||
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
|
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU) $(CONTIKI_CPU)/dev
|
|
||||||
|
|
||||||
### Compilation rules
|
### Compilation rules
|
||||||
|
|
||||||
|
|
||||||
%-stripped.o: %.c
|
%-stripped.o: %.c
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
$(STRIP) --strip-unneeded -g -x $@
|
$(STRIP) --strip-unneeded -g -x $@
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
CONTIKI_CPU_DIRS = . net
|
||||||
|
|
||||||
CONTIKI_SOURCEFILES += mtarch.c rtimer-arch.c elfloader-stub.c
|
CONTIKI_SOURCEFILES += mtarch.c rtimer-arch.c elfloader-stub.c
|
||||||
|
|
||||||
### Compiler definitions
|
### Compiler definitions
|
||||||
|
@ -27,5 +29,3 @@ else
|
||||||
symbols.c symbols.h:
|
symbols.c symbols.h:
|
||||||
@${CONTIKI}/tools/make-empty-symbols
|
@${CONTIKI}/tools/make-empty-symbols
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS += $(CONTIKI_CPU)/net
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
CONTIKI_CPU_DIRS = .
|
||||||
|
|
||||||
CONTIKI_SOURCEFILES += mtarch.c elfloader-x86.c
|
CONTIKI_SOURCEFILES += mtarch.c elfloader-x86.c
|
||||||
|
|
||||||
### Compiler definitions
|
### Compiler definitions
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile.cooja,v 1.14 2007/04/02 10:28:52 fros4943 Exp $
|
# $Id: Makefile.cooja,v 1.15 2007/05/13 08:42:54 oliverschmidt Exp $
|
||||||
|
|
||||||
## The COOJA Simulator Contiki platform Makefile
|
## The COOJA Simulator Contiki platform Makefile
|
||||||
##
|
##
|
||||||
|
@ -83,14 +83,6 @@ CFLAGSNO = -I. -I$(CONTIKI_CPU) \
|
||||||
-Wall -g -I. -I/usr/local/include
|
-Wall -g -I. -I/usr/local/include
|
||||||
CFLAGS = $(CFLAGSNO)
|
CFLAGS = $(CFLAGSNO)
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(COOJA)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU)
|
|
||||||
|
|
||||||
### Define custom targets
|
### Define custom targets
|
||||||
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE)
|
$(LIBFILE): $(MAINFILE) $(PROJECT_OBJECTFILES) $(DEPFILE)
|
||||||
ifdef SYMBOLS
|
ifdef SYMBOLS
|
||||||
|
@ -114,4 +106,3 @@ endif
|
||||||
symbols.c:
|
symbols.c:
|
||||||
# Create initial symbol files if not existing
|
# Create initial symbol files if not existing
|
||||||
${CONTIKI}/tools/make-empty-symbols
|
${CONTIKI}/tools/make-empty-symbols
|
||||||
|
|
|
@ -26,12 +26,3 @@ include $(CONTIKI_CPU)/Makefile.native
|
||||||
CFLAGS += -DCTK_GTKSIM_SERVICE_PNGDIR=\"$(CONTIKI)/platform/gtk\" \
|
CFLAGS += -DCTK_GTKSIM_SERVICE_PNGDIR=\"$(CONTIKI)/platform/gtk\" \
|
||||||
`pkg-config --cflags gtk+-2.0`
|
`pkg-config --cflags gtk+-2.0`
|
||||||
TARGET_LIBFILES = -Wl,-Map=contiki.map,-export-dynamic `pkg-config --libs gtk+-2.0`
|
TARGET_LIBFILES = -Wl,-Map=contiki.map,-export-dynamic `pkg-config --libs gtk+-2.0`
|
||||||
|
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU) $(APP_DIRS)
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ ifndef CONTIKI
|
||||||
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#contiki: contiki-$(TARGET).a
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS = .
|
CONTIKI_TARGET_DIRS = .
|
||||||
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
||||||
|
|
||||||
|
@ -27,11 +25,3 @@ endif
|
||||||
### Define the CPU directory
|
### Define the CPU directory
|
||||||
CONTIKI_CPU=$(CONTIKI)/cpu/native
|
CONTIKI_CPU=$(CONTIKI)/cpu/native
|
||||||
include $(CONTIKI)/cpu/native/Makefile.native
|
include $(CONTIKI)/cpu/native/Makefile.native
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU) $(APP_DIRS)
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ ifndef CONTIKI
|
||||||
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#contiki: contiki-$(TARGET).a
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS = . dev
|
CONTIKI_TARGET_DIRS = . dev
|
||||||
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
||||||
|
|
||||||
|
@ -18,11 +16,3 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
||||||
### Define the CPU directory
|
### Define the CPU directory
|
||||||
CONTIKI_CPU=$(CONTIKI)/cpu/native
|
CONTIKI_CPU=$(CONTIKI)/cpu/native
|
||||||
include $(CONTIKI)/cpu/native/Makefile.native
|
include $(CONTIKI)/cpu/native/Makefile.native
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU) $(APP_DIRS)
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ ifndef CONTIKI
|
||||||
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#contiki: contiki-$(TARGET).a
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS = . dev apps net
|
CONTIKI_TARGET_DIRS = . dev apps net
|
||||||
|
|
||||||
SENSORS = sensors.c beep.c button-sensor.c pir-sensor.c vib-sensor.c \
|
SENSORS = sensors.c beep.c button-sensor.c pir-sensor.c vib-sensor.c \
|
||||||
|
@ -35,13 +33,3 @@ TARGET_LIBFILES = `gtk-config --libs`
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
TARGET_LIBFILES += /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a
|
TARGET_LIBFILES += /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU)
|
|
||||||
|
|
||||||
### Compilation rules
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#
|
#
|
||||||
# Author: Oliver Schmidt <ol.sc@web.de>
|
# Author: Oliver Schmidt <ol.sc@web.de>
|
||||||
#
|
#
|
||||||
# $Id: Makefile.win32,v 1.7 2007/04/21 22:17:22 oliverschmidt Exp $
|
# $Id: Makefile.win32,v 1.8 2007/05/13 08:46:18 oliverschmidt Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ifndef CONTIKI
|
ifndef CONTIKI
|
||||||
|
@ -77,10 +77,3 @@ $(PRGS:=.prg):
|
||||||
$(LD) -shared $^ contiki-main.$(TARGET).a -o $@
|
$(LD) -shared $^ contiki-main.$(TARGET).a -o $@
|
||||||
$(DSCS:=.dsc):
|
$(DSCS:=.dsc):
|
||||||
$(LD) -shared $^ contiki-main.$(TARGET).a -o $@
|
$(LD) -shared $^ contiki-main.$(TARGET).a -o $@
|
||||||
|
|
||||||
### Setup directory search path for source files
|
|
||||||
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
|
||||||
$(CONTIKI_TARGET_DIRS)}
|
|
||||||
vpath %.c $(PROJECTDIRS) \
|
|
||||||
$(CONTIKIDIRS) $(APPDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
|
|
||||||
$(CONTIKI_CPU) $(APP_DIRS)
|
|
||||||
|
|
Loading…
Reference in a new issue