xwords/xwords4/wince/Makefile

150 lines
3.5 KiB
Makefile
Raw Normal View History

# -*- compile-command: "make TARGET_OS=wince"; -*-
# 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
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
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
STANDALONE = -DXWFEATURE_STANDALONE_ONLY
2006-02-14 05:54:28 +01:00
CFLAGS += -D_WIN32_WCE=400 -DUNDER_CE -DMY_COLOR_SEL \
$(STANDALONE) \
-fdollars-in-identifiers -D__W32API_USE_DLLIMPORT__
LFLAGS += -Wl,--major-subsystem-version,4,--minor-subsystem-version,20
ifdef HAVE_COMMCTRL
CELIBS += -lcommctrl -laygshell
else
CFLAGS += -DCANT_DO_CMDBAR -DCANT_DO_SHELL_THING -DBEYOND_IR
endif
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
CFLAGS += -DCANT_DO_CMDBAR -DCANT_DO_SHELL_THING -DBEYOND_IR
endif
endif
CFLAGS += -DARM -I$(MINGW_INC_PATH) -I./ -I../common -I../relay
2006-02-07 15:46:08 +01:00
ifeq ($(DEBUG),TRUE)
MEM_DEBUG_FLAG=-DMEM_DEBUG
DEBUG_FLAG=-DDEBUG
CFLAGS += -g -DDEBUG_TS
2006-02-07 15:46:08 +01:00
OBJDIR = obj_$(TARGET_OS)_dbg
else
CFLAGS += -Os
2006-02-07 15:46:08 +01:00
OBJDIR = obj_$(TARGET_OS)
endif
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 \
debhacks.c \
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 \
-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) \
CFLAGS += $(XW_BOTH_DEFINES) -DARM
####################################################################
# Rules start here
####################################################################
all : $(TARGET)
memdebug:
2006-02-07 15:46:08 +01:00
$(MAKE) DEBUG=TRUE all
$(TARGET) : $(OBJS) $(RESOBJS)
$(CC) $(CFLAGS) $(LFLAGS) -mwindows $^ $(CELIBS) -o $@
$(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) \
-D_WIN32_WCE=400 -D_WIN32 -D_WIN32_IE=0x0400 \
$(STANDALONE) \
-o $@ $<
SHIP: $(TARGET)
$(STRIP) $<
ifdef WINCE_UPLOAD_LOC
cp $< $(WINCE_UPLOAD_LOC)
endif
test:
echo $(COMMONOBJ)
clean :
rm -rf $(OBJDIR) $(TARGET)
help:
@echo "try 'make TARGET_OS=wince'"
@echo "or 'make TARGET_OS=win32'"