source: trunk/source/lisp-kernel/win32/Makefile @ 15198

Last change on this file since 15198 was 15198, checked in by gb, 9 years ago

Add lisp_globals.s to remaining Makefiles.

File size: 3.7 KB
Line 
1#
2#   Copyright (C) 2008-2011 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
16# This makefile is written to be used with the mingw toolchain
17# running in the Cygwin environment.
18#
19# Install the following Cygwin packages:
20# * make
21# * m4
22# * mingw64-i686-binutils
23# * mingw64-i686-gcc-core
24# * mingw64-i686-headers
25# * mingw64-i686-pthreads
26# * mingw64-i686-runtime
27#
28# Accept the dependencies the installation tool may add.
29
30SVN_REVISION := "$(shell svnversion || echo unknown)"
31
32VPATH = ../
33RM = rm
34CC = i686-w64-mingw32-gcc
35AS = i686-w64-mingw32-as
36M4 = m4
37LD = i686-w64-mingw32-ld
38ASFLAGS = -g --32
39M4FLAGS = -DWIN_32 -DWINDOWS -DX86 -DX8632
40CDEFINES = -DWIN_32 -DWINDOWS -D_REENTRANT -DX86 -DX8632 -D_GNU_SOURCE  -D__MSVCRT__ -D__MSVCRT_VERSION__=0x700 -D_WIN32_WINNT=0x0502 -DSVN_REVISION=$(SVN_REVISION)
41CDEBUG = -g
42COPT = -O
43# Once in a while, -Wformat says something useful.  The odds are against that,
44# however.
45WFORMAT = -Wno-format
46PLATFORM_H = platform-win32.h
47
48# If the linker supports a "--hash-style=" option, use traditional
49# SysV hash tables.  (If it doesn't support that option, assume
50# that traditional hash tables will be used by default.)
51ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
52ifeq ($(ld_has_hash_style),)
53HASH_STYLE=
54else
55HASH_STYLE="-Wl,--hash-style=sysv"
56endif
57
58# There may be some confusion about whether or not C symbols have
59# leading underscores or not.  The assembler sources seem to
60# expect them to and mingw import libs seem to use them, but
61# it's not clear whether or not native win64 libraries use this
62# convention (and I'm not sure whether the Cygwin-hosted win64
63# toolchain behaves the same way as when hosted on Linux ...
64# The compiler default seems to be to use them; if we want to
65# suppress their use, uncomment the following:
66
67SUPPRESS_UNDERSCORES=#-fno-leading-underscore
68
69.s.o:
70        $(M4) $(M4FLAGS) -I../ $< | $(AS)  $(ASFLAGS) -o $@
71.c.o:
72        $(CC) -m32 -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) ${SUPPRESS_UNDERSCORES} -o $@
73
74# order matters: x86-spjump32.o must be first.
75SPOBJ = x86-spjump32.o x86-spentry32.o x86-subprims32.o
76ASMOBJ = x86-asmutils32.o imports.o
77
78COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
79        x86-utils.o \
80        image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
81
82DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
83KERNELOBJ= $(COBJ) x86-asmutils32.o  imports.o
84
85SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
86        x86-constants32.s lisp_globals.s
87
88CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
89        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
90        threads.h x86-constants32.h x86-exceptions.h lisptypes.h \
91        x86-utils.h \
92        $(PLATFORM_H) constants.h os-windows.h
93
94
95KSPOBJ = $(SPOBJ)
96all:    ../../wx86cl.exe
97
98OSLIBS = -lpsapi -lws2_32
99
100../../wx86cl.exe: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
101        $(CC) -m32 -o ../../wx86cl.exe  -Wl,--image-base=0x10000 \
102        -Wl,--enable-auto-import \
103        $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
104
105
106$(SPOBJ): $(SPINC)
107$(ASMOBJ): $(SPINC)
108$(COBJ): $(CHEADERS)
109$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
110
111
112cclean:
113        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl.exe
114
115clean:  cclean
116        $(RM) -f $(SPOBJ)
117
118strip:  ../../wx86cl.exe
119        strip -g ../../wx86cl.exe
Note: See TracBrowser for help on using the repository browser.