source: release/1.3/source/lisp-kernel/win32/Makefile @ 11920

Last change on this file since 11920 was 11920, checked in by rme, 10 years ago

Merge r11785 (build win32 kernel with mingw/msys, too) from trunk.

File size: 3.5 KB
Line 
1#
2#   Copyright (C) 2008 Clozure Associates
3#   This file is part of OpenMCL. 
4#
5#   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
6#   License , known as the LLGPL and distributed with OpenMCL as the
7#   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8#   which is distributed with OpenMCL as the file "LGPL".  Where these
9#   conflict, the preamble takes precedence. 
10#
11#   OpenMCL is referenced in the preamble as the "LIBRARY."
12#
13#   The LLGPL is also available online at
14#   http://opensource.franz.com/preamble.html
15
16
17VPATH = ../
18RM = /bin/rm
19CC = gcc
20AS = as
21M4 = m4
22LD = ld
23ASFLAGS = -g --32
24M4FLAGS = -DWIN_32 -DWINDOWS -DX86 -DX8632 -DWIN32_ES_HACK
25CDEFINES = -DWIN_32 -DWINDOWS -D_REENTRANT -DX86 -DX8632 -D_GNU_SOURCE  -D__MSVCRT__ -D__MSVCRT_VERSION__=0x700 -D_WIN32_WINNT=0x0502 -DWIN32_ES_HACK
26CDEBUG = -g
27COPT = #-O2
28
29# If the linker supports a "--hash-style=" option, use traditional
30# SysV hash tables.  (If it doesn't support that option, assume
31# that traditional hash tables will be used by default.)
32ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
33ifeq ($(ld_has_hash_style),)
34HASH_STYLE=
35else
36HASH_STYLE="-Wl,--hash-style=sysv"
37endif
38
39CRT2 = $(shell $(CC) -mno-cygwin -print-file-name=crt2.o)
40
41# There may be some confusion about whether or not C symbols have
42# leading underscores or not.  The assembler sources seem to
43# expect them to and mingw import libs seem to use them, but
44# it's not clear whether or not native win64 libraries use this
45# convention (and I'm not sure whether the Cygwin-hosted win64
46# toolchain behaves the same way as when hosted on Linux ...
47# The compiler default seems to be to use them; if we want to
48# suppress their use, uncomment the following:
49
50SUPPRESS_UNDERSCORES=#-fno-leading-underscore
51
52.s.o:
53        $(M4) $(M4FLAGS) -I../ $< | $(AS)  $(ASFLAGS) -o $@
54.c.o:
55        $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) ${SUPPRESS_UNDERSCORES} -mno-cygwin -o $@
56
57# order matters: x86-spjump32.o must be first.
58SPOBJ = x86-spjump32.o x86-spentry32.o x86-subprims32.o
59ASMOBJ = x86-asmutils32.o imports.o
60
61COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
62        image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
63
64DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
65KERNELOBJ= $(COBJ) x86-asmutils32.o  imports.o
66
67SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
68        x86-constants32.s
69
70CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
71        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
72        Threads.h x86-constants32.h x86-exceptions.h lisptypes.h
73
74
75KSPOBJ = $(SPOBJ)
76all:    ../../wx86cl.exe
77
78# Order matters: libs that provide definitions must follow libs that
79# reference them.  (It's legal to use -lfoo multiple times to try to
80# work around this.)
81LIBGCC = $(shell $(CC) -mno-cygwin -print-libgcc-file-name)
82OSLIBS =  -L/usr/lib/w32api -L/mingw/lib -L/usr/lib/mingw\
83        -lm -lpsapi -lws2_32 -lmingw32 $(LIBGCC) -lmoldname -lmingwex \
84        -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32  $(GCCLIB) \
85        -lmoldname -lmingwex -lmsvcrt
86
87
88
89IMAGE_BASE =--image-base=0x10000
90
91../../wx86cl.exe: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
92        ld -o ../../wx86cl.exe  $(IMAGE_BASE) --enable-auto-import \
93        $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(CRT2) $(OSLIBS) $(LIBGCC) $(LATELIBS)
94
95
96$(SPOBJ): $(SPINC)
97$(ASMOBJ): $(SPINC)
98$(COBJ): $(CHEADERS)
99$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
100
101
102cclean:
103        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl.exe
104
105clean:  cclean
106        $(RM) -f $(SPOBJ)
107
108strip:  ../../wx86cl.exe
109        strip -g ../../wx86cl.exe
Note: See TracBrowser for help on using the repository browser.