Allow Cygwin based Win32 platform to be used for 'project builds' (in the sense of the Contiki 2.x build system) beside the exsisting 'platform build'.

This commit is contained in:
oliverschmidt 2007-12-15 00:00:34 +00:00
parent 3a3a98fc0f
commit b89a08be8b
4 changed files with 53 additions and 30 deletions

View file

@ -30,7 +30,7 @@
# #
# Author: Oliver Schmidt <ol.sc@web.de> # Author: Oliver Schmidt <ol.sc@web.de>
# #
# $Id: Makefile,v 1.6 2007/11/18 01:15:35 oliverschmidt Exp $ # $Id: Makefile,v 1.7 2007/12/15 00:00:34 oliverschmidt Exp $
# #
PRGS = about calc dhcp directory email ftp irc netconf processes shell \ PRGS = about calc dhcp directory email ftp irc netconf processes shell \
@ -47,7 +47,9 @@ override telnetd_src = telnetd.c telnetd-gui.c memb.c shell.c
# Use webserver.c instead of webserver-nogui.c to get CTK support # Use webserver.c instead of webserver-nogui.c to get CTK support
override webserver_src = webserver.c httpd.c http-strings.c psock.c \ override webserver_src = webserver.c httpd.c http-strings.c psock.c \
memb.c httpd-fs.c httpd-cgi.c memb.c httpd-fs.c httpd-cgi.c
PLATFORM_BUILD = 1
CONTIKI = ../.. CONTIKI = ../..
APPS = program-handler ${call appname,$(PRGS)} APPS = program-handler ${call appname,$(PRGS)}
TARGET = win32 TARGET = win32

View file

@ -30,7 +30,7 @@
# #
# Author: Oliver Schmidt <ol.sc@web.de> # Author: Oliver Schmidt <ol.sc@web.de>
# #
# $Id: Makefile.win32,v 1.10 2007/05/20 21:43:21 oliverschmidt Exp $ # $Id: Makefile.win32,v 1.11 2007/12/15 00:00:34 oliverschmidt Exp $
# #
ifndef CONTIKI ifndef CONTIKI
@ -43,7 +43,7 @@ CONTIKI_TARGET_DIRS = . cfs ctk loader
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o} CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
CONTIKI_TARGET_SOURCEFILES = contiki-main.c clock.c cfs-win32.c \ CONTIKI_TARGET_SOURCEFILES = contiki-main.c clock.c cfs-win32.c \
ctk-console.c dll-loader.c ctk-console.c
CONTIKI_SOURCEFILES += $(CTK) ctk-conio.c wpcap.c wpcap-drv.c \ CONTIKI_SOURCEFILES += $(CTK) ctk-conio.c wpcap.c wpcap-drv.c \
$(CONTIKI_TARGET_SOURCEFILES) $(CONTIKI_TARGET_SOURCEFILES)
@ -54,9 +54,12 @@ CONTIKI_SOURCEFILES += $(CTK) ctk-conio.c wpcap.c wpcap-drv.c \
CONTIKI_CPU = $(CONTIKI)/cpu/native CONTIKI_CPU = $(CONTIKI)/cpu/native
include $(CONTIKI)/cpu/native/Makefile.native include $(CONTIKI)/cpu/native/Makefile.native
CFLAGS += -DWITH_LOADER_ARCH ifdef PLATFORM_BUILD
CONTIKI_TARGET_SOURCEFILES += dll-loader.c
CFLAGS += -DPLATFORM_BUILD -DWITH_LOADER_ARCH
LDFLAGS += -Wl,--out-implib=contiki-main.$(TARGET).a \ LDFLAGS += -Wl,--out-implib=contiki-main.$(TARGET).a \
-u _cfs_open -u _uiplib_ipaddrconv -u _cfs_open -u _uiplib_ipaddrconv
endif
### Generate the module-link prerequisites ### Generate the module-link prerequisites
define prg_template define prg_template

View file

@ -2,25 +2,25 @@
#define __CONTIKI_CONF_H__ #define __CONTIKI_CONF_H__
#define CC_CONF_REGISTER_ARGS 1 #define CC_CONF_REGISTER_ARGS 1
#define CC_CONF_FASTCALL __fastcall #define CC_CONF_FASTCALL __fastcall
#define CC_CONF_INLINE __inline #define CC_CONF_INLINE __inline
#if _USRDLL #if _USRDLL
#define CCIF __declspec(dllimport) #define CCIF __declspec(dllimport)
#else #else /* _USRDLL */
#define CCIF __declspec(dllexport) #define CCIF __declspec(dllexport)
#endif #endif /* _USRDLL */
#define CLIF __declspec(dllexport) #define CLIF __declspec(dllexport)
#ifdef __CYGWIN__ #ifdef __CYGWIN__
int strcasecmp(const char*, const char*); int strcasecmp(const char*, const char*);
char* strdup(const char*); char* strdup(const char*);
#else #else /* __CYGWIN__ */
#define strcasecmp _stricmp #define strcasecmp _stricmp
#define strdup _strdup #define strdup _strdup
#endif #endif /* __CYGWIN__ */
#define LOG_CONF_ENABLED 1 #define LOG_CONF_ENABLED 1
@ -76,26 +76,36 @@ typedef unsigned short uip_stats_t;
#define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */ #define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */
#define CTK_CONF_WIDGETDOWN_KEY '\t' #define CTK_CONF_WIDGETDOWN_KEY '\t'
#define CTK_CONF_WIDGETUP_KEY -7 /* Shift-Tab */ #define CTK_CONF_WIDGETUP_KEY -7 /* Shift-Tab */
#define CTK_CONF_MOUSE_SUPPORT 1
#define CTK_CONF_WINDOWS 1
#define CTK_CONF_ICONS 1
#define CTK_CONF_ICON_BITMAPS 0
#define CTK_CONF_ICON_TEXTMAPS 1
#define CTK_CONF_WINDOWMOVE 1
#define CTK_CONF_WINDOWCLOSE 1
#define CTK_CONF_MENUS 1
#define CTK_CONF_MENUWIDTH 16
#define CTK_CONF_MAXMENUITEMS 10
#define CTK_CONF_WIDGET_FLAGS 0 #define CTK_CONF_WIDGET_FLAGS 0
#define CTK_CONF_SCREENSAVER 0 #define CTK_CONF_SCREENSAVER 0
#define CTK_CONF_HYPERLINK 1 #define CTK_CONF_HYPERLINK 1
#define COLOR_BLACK (0) #ifdef PLATFORM_BUILD
#define COLOR_BLUE (1) #define CTK_CONF_MOUSE_SUPPORT 1
#define COLOR_GRAY (1 | 2 | 4) #define CTK_CONF_WINDOWS 1
#define COLOR_CYAN (1 | 2 | 8) #define CTK_CONF_WINDOWMOVE 1
#define COLOR_YELLOW (2 | 4 | 8) #define CTK_CONF_WINDOWCLOSE 1
#define COLOR_WHITE (1 | 2 | 4 | 8) #define CTK_CONF_ICONS 1
#define CTK_CONF_ICON_BITMAPS 0
#define CTK_CONF_ICON_TEXTMAPS 1
#define CTK_CONF_MENUS 1
#define CTK_CONF_MENUWIDTH 16
#define CTK_CONF_MAXMENUITEMS 10
#else /* PLATFORM_BUILD */
#define CTK_CONF_MOUSE_SUPPORT 0
#define CTK_CONF_WINDOWS 0
#define CTK_CONF_WINDOWMOVE 0
#define CTK_CONF_WINDOWCLOSE 0
#define CTK_CONF_ICONS 0
#define CTK_CONF_MENUS 0
#endif /* PLATFORM_BUILD */
#define COLOR_BLACK (0)
#define COLOR_BLUE (1)
#define COLOR_GRAY (1 | 2 | 4)
#define COLOR_CYAN (1 | 2 | 8)
#define COLOR_YELLOW (2 | 4 | 8)
#define COLOR_WHITE (1 | 2 | 4 | 8)
#define BORDERCOLOR COLOR_BLACK #define BORDERCOLOR COLOR_BLACK
#define SCREENCOLOR COLOR_BLACK #define SCREENCOLOR COLOR_BLACK
@ -113,7 +123,9 @@ typedef unsigned short uip_stats_t;
#define ACTIVEMENUITEMCOLOR COLOR_YELLOW | COLOR_BLUE * 0x10 #define ACTIVEMENUITEMCOLOR COLOR_YELLOW | COLOR_BLUE * 0x10
#ifdef PLATFORM_BUILD
#define LOADER_CONF_ARCH "loader/dll-loader.h" #define LOADER_CONF_ARCH "loader/dll-loader.h"
#endif /* PLATFORM_BUILD */
#define PROGRAM_HANDLER_CONF_MAX_NUMDSCS 10 #define PROGRAM_HANDLER_CONF_MAX_NUMDSCS 10
#define PROGRAM_HANDLER_CONF_QUIT_MENU 1 #define PROGRAM_HANDLER_CONF_QUIT_MENU 1

View file

@ -30,7 +30,7 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: contiki-main.c,v 1.12 2007/05/23 22:01:14 oliverschmidt Exp $ * $Id: contiki-main.c,v 1.13 2007/12/15 00:00:34 oliverschmidt Exp $
*/ */
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
@ -53,9 +53,11 @@
PROCINIT(&etimer_process, PROCINIT(&etimer_process,
&wpcap_process, &wpcap_process,
&ctk_process, &ctk_process,
#ifdef PLATFORM_BUILD
&program_handler_process,
#endif /* PLATFORM_BUILD */
&tcpip_process, &tcpip_process,
&resolv_process, &resolv_process);
&program_handler_process);
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
void void
@ -90,8 +92,12 @@ main(void)
procinit_init(); procinit_init();
#ifdef PLATFORM_BUILD
program_handler_add(&directory_dsc, "Directory", 1); program_handler_add(&directory_dsc, "Directory", 1);
program_handler_add(&www_dsc, "Web browser", 1); program_handler_add(&www_dsc, "Web browser", 1);
#else /* PLATFORM_BUILD */
autostart_start((struct process **)autostart_processes);
#endif /* PLATFORM_BUILD */
#if 1 #if 1
{ {