source: branches/shrink-tcr/lisp-kernel/win32/Makefile @ 14607

Last change on this file since 14607 was 14607, checked in by rme, 9 years ago

More tweaks; a cross-compiled Windows x86 lisp now bootstraps on Windows x64.

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