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

Last change on this file since 13638 was 13638, checked in by gb, 10 years ago

Move more PPC exception stuff, x86 exception stuff to platform heeaders.
Introduce OS headers; so far, just signal constants. Include the applicable
os-*.h in platform-*.h.
Ensure that Makefiles have constants.h, os*.h in CHEADERS.
Will try to smoke-test & fix typos before sleeping.

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