From 9071007e1e6ecd2f94d9397c07fa3718be1aa5c1 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Tue, 4 Mar 2008 22:55:54 +0000 Subject: [PATCH] For the Win32 platform build we need to define AUTOSTART_ENABLE even for the Contiki library files to be able to autostart the program handler. Note: For this to work the program handler needs to be the first autostart enabled application in the Contiki library. As the GNU archiver guarantees to preserve the order of the object files in a library this can be accomplished by having the program handler the first item in APPS. --- platform/win32/Makefile.win32 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/platform/win32/Makefile.win32 b/platform/win32/Makefile.win32 index 2ef1e5da4..aad28ba32 100644 --- a/platform/win32/Makefile.win32 +++ b/platform/win32/Makefile.win32 @@ -30,7 +30,7 @@ # # Author: Oliver Schmidt # -# $Id: Makefile.win32,v 1.13 2008/02/08 22:55:59 oliverschmidt Exp $ +# $Id: Makefile.win32,v 1.14 2008/03/04 22:55:54 oliverschmidt Exp $ # ifndef CONTIKI @@ -40,8 +40,6 @@ endif TARGET_LIBFILES = /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a CONTIKI_TARGET_DIRS = . cfs ctk loader -CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o} - CONTIKI_TARGET_SOURCEFILES = contiki-main.c clock.c cfs-win32.c \ ctk-console.c @@ -56,7 +54,7 @@ include $(CONTIKI)/cpu/native/Makefile.native ifdef PLATFORM_BUILD CONTIKI_TARGET_SOURCEFILES += dll-loader.c -CFLAGS += -DPLATFORM_BUILD -DWITH_LOADER_ARCH +CFLAGS += -DPLATFORM_BUILD -DWITH_LOADER_ARCH -DAUTOSTART_ENABLE LDFLAGS += -Wl,--out-implib=contiki-main.$(TARGET).a \ -u _cfs_open -u _uiplib_ipaddrconv endif @@ -75,7 +73,7 @@ ${foreach DSC,$(DSCS),${eval ${call dsc_template,$(DSC),${call appname,$(DSC)}}} ### (The *.d files contain the full module-compile prerequisites) ${sort ${foreach PRG,$(PRGS), ${addprefix $(OBJECTDIR)/, \ $(${call appname,$(PRG)_src:.c=.o})}}}: - $(CC) $(CFLAGS) -DAUTOSTART_ENABLE -D_USRDLL -c $< -o $@ + $(CC) $(CFLAGS) -D_USRDLL -c $< -o $@ $(PRGS:=.prg): $(LD) -shared $^ contiki-main.$(TARGET).a -o $@ $(DSCS:=.dsc):