##   -*-Makefile-*-
##
##  IMS Open Corpus Workbench (CWB)
##  Copyright (C) 1993-2006 by IMS, University of Stuttgart
##  Copyright (C) 2007-     by the respective contributers (see file AUTHORS)
##
##  This program is free software; you can redistribute it and/or modify it
##  under the terms of the GNU General Public License as published by the
##  Free Software Foundation; either version 2, or (at your option) any later
##  version.
##
##  This program is distributed in the hope that it will be useful, but
##  WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
##  Public License for more details (in the file "COPYING", or available via
##  WWW at http://www.gnu.org/copyleft/gpl.html).

##
## PLATFORM CONFIGURATION FILE: Windows on i586-compatible CPU, cross-compiled using MinGW
##

## this variable is checked with "ifdefs" in makefiles that need to do something different
## when we are cross-compiling for windows...
__MINGW__ = 1
## if a "unix-to-dos" conversion program is specified here, it will be used when creating
## windows releases (for text files containing instructions e.g. README.txt, thus enabling
## Notepad.exe (inter alia) to read them without mangling the linebreaks).
## Note that while unix2dos exists on many platforms, Ubuntu has removed it.
UNIX2DOS = unix2dos

## C compiler
CC = i586-mingw32msvc-gcc

## we also MAY need the following sub-programs...
LD = i586-mingw32msvc-ld
RC = i586-mingw32msvc-windres

## C compiler flags (optimisation, warning, additional include directories)
## in this case, we also have the __MINGW__ macro-constant that is "ifdef" checked in the C code 
CFLAGS = -O2 -Wall -D__MINGW__ -DEMULATE_SETENV
## MinGW doesn't have setenv() for manipulating environment variables, so we need to emulate it with putenv()
## this is controlled by EMULATE_SETENV, created for Solaris but also useful here.

## Linker flags (libraries to link against, search path, static linkage)
LDFLAGS = -lm -lws2_32

## Parser and lexical scanner generator (recommended combination is bison + flex)
YACC = bison -d -t
LEX = flex -8

## How to combine object files into a library archive (*.a) and build a table of contents
## (ranlib is optional, simply set to "echo" or so to skip
AR = i586-mingw32msvc-ar cq
RANLIB = i586-mingw32msvc-ranlib


## Windows binaries must end in .EXE
EXEC_SUFFIX = .exe

## CPU architecture and operating system used to name binary releases
RELEASE_ARCH = i586
RELEASE_OS = windows

## How to update dependencies between source code files ("make depend" requires this option to be set)
DEPEND = i586-mingw32msvc-gcc -MM -MG

## How to index source code symbols for Emacs editor ("make tags" requires this option to be set)
ETAGS = etags


