2006-02-06 05:48:20 +01:00
|
|
|
# -*- compile-command: "make TARGET_OS=wince"; -*-
|
2005-11-27 21:27:46 +01:00
|
|
|
# This Makefile is meant to allow building Crosswords for PocketPC and
|
|
|
|
# Windows using Linux. As of Nov 27, 2005, it compiles and runs (on
|
|
|
|
# XP) enough to draw its board, but then crashes. It appears from the
|
|
|
|
# log that an assert is failing.
|
|
|
|
#
|
|
|
|
# It does not yet link for PPC.
|
|
|
|
#
|
|
|
|
# I'm bulding on Debian's "testing" distribution, current as of the
|
|
|
|
# above date. Here are some of the packages I had to install to build
|
|
|
|
# for win32. I make no guarantees this list is complete.
|
|
|
|
#
|
|
|
|
# mingw32 mingw32-binutils mingw32-runtime
|
|
|
|
|
|
|
|
PLATFORM = wince
|
|
|
|
|
2006-02-06 05:48:20 +01:00
|
|
|
TARGET_OS ?= win32
|
|
|
|
#TARGET_OS = wince
|
|
|
|
|
|
|
|
MINGW_INC_PATH ?= /usr/i586-mingw32msvc/include
|
|
|
|
|
|
|
|
# This requires custom Debian pocketpc-sdk package at the moment
|
|
|
|
HAVE_COMMCTRL = 1
|
2005-11-27 21:27:46 +01:00
|
|
|
|
|
|
|
ifeq ($(TARGET_OS),wince)
|
|
|
|
CC = arm-wince-pe-gcc
|
|
|
|
WINDRES = arm-wince-pe-windres
|
|
|
|
STRIP = arm-wince-pe-strip
|
|
|
|
CELIBS = -L/usr/arm-wince-pe/lib
|
|
|
|
TARGET_OS_DEF = -DTARGET_OS_WINCE
|
2006-02-06 05:48:20 +01:00
|
|
|
STANDALONE = -DXWFEATURE_STANDALONE_ONLY
|
2006-02-14 05:54:28 +01:00
|
|
|
CFLAGS += -D_WIN32_WCE=400 -DUNDER_CE -DMY_COLOR_SEL \
|
2006-02-06 05:48:20 +01:00
|
|
|
$(STANDALONE) \
|
|
|
|
-fdollars-in-identifiers -D__W32API_USE_DLLIMPORT__
|
2006-02-06 16:00:46 +01:00
|
|
|
LFLAGS += -Wl,--major-subsystem-version,4,--minor-subsystem-version,20
|
2006-02-06 05:48:20 +01:00
|
|
|
ifdef HAVE_COMMCTRL
|
|
|
|
CELIBS += -lcommctrl -laygshell
|
|
|
|
else
|
|
|
|
CFLAGS += -DCANT_DO_CMDBAR -DCANT_DO_SHELL_THING -DBEYOND_IR
|
|
|
|
endif
|
2005-11-27 21:27:46 +01:00
|
|
|
else
|
|
|
|
ifeq ($(TARGET_OS),win32)
|
|
|
|
CC = i586-mingw32msvc-gcc
|
|
|
|
WINDRES = i586-mingw32msvc-windres
|
|
|
|
STRIP = i586-mingw32msvc-strip
|
|
|
|
TARGET_OS_DEF = -DTARGET_OS_WIN32
|
|
|
|
CELIBS += -lws2_32
|
2006-02-06 05:48:20 +01:00
|
|
|
CFLAGS += -DCANT_DO_CMDBAR -DCANT_DO_SHELL_THING -DBEYOND_IR
|
2005-11-27 21:27:46 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2006-02-06 05:48:20 +01:00
|
|
|
CFLAGS += -DARM -I$(MINGW_INC_PATH) -I./ -I../common -I../relay
|
2005-11-27 21:27:46 +01:00
|
|
|
|
2006-02-07 15:46:08 +01:00
|
|
|
ifeq ($(DEBUG),TRUE)
|
|
|
|
MEM_DEBUG_FLAG=-DMEM_DEBUG
|
|
|
|
DEBUG_FLAG=-DDEBUG
|
2006-02-06 16:00:46 +01:00
|
|
|
CFLAGS += -g -DDEBUG_TS
|
2006-02-07 15:46:08 +01:00
|
|
|
OBJDIR = obj_$(TARGET_OS)_dbg
|
2006-02-06 16:00:46 +01:00
|
|
|
else
|
|
|
|
CFLAGS += -Os
|
2006-02-07 15:46:08 +01:00
|
|
|
OBJDIR = obj_$(TARGET_OS)
|
2006-02-06 16:00:46 +01:00
|
|
|
endif
|
|
|
|
|
2005-11-27 21:27:46 +01:00
|
|
|
TARGET = $(OBJDIR)/xwords4.exe
|
|
|
|
|
|
|
|
RESOBJS = \
|
|
|
|
$(OBJDIR)/xwords4.rc.o \
|
|
|
|
|
|
|
|
WINCESRC = \
|
|
|
|
ceaskpwd.c \
|
|
|
|
ceclrsel.c\
|
|
|
|
cedict.c \
|
|
|
|
ceginfo.c \
|
|
|
|
cemain.c \
|
|
|
|
cesockwr.c \
|
|
|
|
ceutil.c \
|
|
|
|
ceblank.c \
|
|
|
|
cecondlg.c \
|
|
|
|
cehntlim.c \
|
|
|
|
ceprefs.c \
|
|
|
|
cestrbx.c \
|
|
|
|
cedraw.c \
|
2006-01-28 20:05:39 +01:00
|
|
|
debhacks.c \
|
2005-11-27 21:27:46 +01:00
|
|
|
|
|
|
|
WINCEOBJS = $(patsubst %.c,%.o,$(addprefix $(OBJDIR)/,$(WINCESRC)))
|
|
|
|
|
|
|
|
include ../common/config.mk
|
|
|
|
|
|
|
|
COMMONOBJ = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(notdir $(COMMONSRC))))
|
|
|
|
|
|
|
|
OBJS = $(WINCEOBJS) $(COMMONOBJ)
|
|
|
|
|
|
|
|
WINCE_INCLUDES = $(shell ls *.h)
|
|
|
|
COMMON_INCLUDES = $(shell ls ../common/*.h)
|
|
|
|
|
|
|
|
INCLUDES = $(WINCE_INCLUDES) $(COMMON_INCLUDES)
|
|
|
|
|
|
|
|
XW_BOTH_DEFINES = \
|
|
|
|
$(TARGET_OS_DEF) \
|
2006-02-14 05:54:28 +01:00
|
|
|
-DNODE_CAN_4 \
|
2005-11-27 21:27:46 +01:00
|
|
|
-DCOLOR_SUPPORT -DFEATURE_TRAY_EDIT -DXWFEATURE_SEARCHLIMIT \
|
|
|
|
-DXWFEATURE_HINT_CONFIG \
|
|
|
|
-DPOINTER_SUPPORT -DKEY_SUPPORT -D__LITTLE_ENDIAN \
|
|
|
|
-DCEFEATURE_CANSCROLL -DUNICODE \
|
2006-02-07 15:46:08 +01:00
|
|
|
$(DEBUG_FLAG) $(MEM_DEBUG_FLAG) \
|
2005-11-27 21:27:46 +01:00
|
|
|
|
|
|
|
CFLAGS += $(XW_BOTH_DEFINES) -DARM
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Rules start here
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
all : $(TARGET)
|
2006-02-06 16:00:46 +01:00
|
|
|
|
|
|
|
memdebug:
|
2006-02-07 15:46:08 +01:00
|
|
|
$(MAKE) DEBUG=TRUE all
|
2005-11-27 21:27:46 +01:00
|
|
|
|
|
|
|
$(TARGET) : $(OBJS) $(RESOBJS)
|
2006-02-06 16:00:46 +01:00
|
|
|
$(CC) $(CFLAGS) $(LFLAGS) -mwindows $^ $(CELIBS) -o $@
|
2005-11-27 21:27:46 +01:00
|
|
|
|
|
|
|
$(OBJDIR)/%.o : %.c $(INCLUDES)
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o : ../common/%.c $(INCLUDES)
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/xwords4.rc.o : xwords4.rc $(INCLUDES)
|
2006-02-07 15:46:08 +01:00
|
|
|
$(WINDRES) -v -I$(MINGW_INC_PATH) $(DEBUG_FLAG) $(MEM_DEBUG_FLAG) \
|
2006-02-06 05:48:20 +01:00
|
|
|
-D_WIN32_WCE=400 -D_WIN32 -D_WIN32_IE=0x0400 \
|
|
|
|
$(STANDALONE) \
|
2005-11-27 21:27:46 +01:00
|
|
|
-o $@ $<
|
|
|
|
|
|
|
|
SHIP: $(TARGET)
|
|
|
|
$(STRIP) $<
|
2006-01-28 20:05:39 +01:00
|
|
|
ifdef WINCE_UPLOAD_LOC
|
|
|
|
cp $< $(WINCE_UPLOAD_LOC)
|
2005-11-27 21:27:46 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
test:
|
|
|
|
echo $(COMMONOBJ)
|
|
|
|
|
|
|
|
clean :
|
|
|
|
rm -rf $(OBJDIR) $(TARGET)
|
2006-02-06 05:48:20 +01:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "try 'make TARGET_OS=wince'"
|
|
|
|
@echo "or 'make TARGET_OS=win32'"
|