summaryrefslogtreecommitdiff
path: root/asmrun/Makefile.nt
blob: d505b25a96e182753f9a81c4d09bf57e2559046e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#########################################################################
#                                                                       #
#                            Objective Caml                             #
#                                                                       #
#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
#                                                                       #
#   Copyright 1999 Institut National de Recherche en Informatique et    #
#   en Automatique.  All rights reserved.  This file is distributed     #
#   under the terms of the GNU Library General Public License, with     #
#   the special exception on linking described in file ../LICENSE.      #
#                                                                       #
#########################################################################

# $Id$

include ../config/Makefile

CC=$(NATIVECC)
CFLAGS=-I../byterun -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(NATIVECCCOMPOPTS)

COBJS=startup.$(O) main.$(O) fail.$(O) roots.$(O) signals.$(O) \
  misc.$(O) freelist.$(O) major_gc.$(O) minor_gc.$(O) memory.$(O) alloc.$(O) \
  compare.$(O) ints.$(O) floats.$(O) str.$(O) array.$(O) io.$(O) extern.$(O) \
  intern.$(O) hash.$(O) sys.$(O) parsing.$(O) gc_ctrl.$(O) terminfo.$(O) \
  md5.$(O) obj.$(O) lexing.$(O) win32.$(O) printexc.$(O) callback.$(O) \
  weak.$(O) compact.$(O) finalise.$(O) custom.$(O) globroots.$(O)

LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \
  compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \
  parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \
  weak.c compact.c meta.c finalise.c custom.c main.c globroots.c \
  dynlink.c

ifeq ($(TOOLCHAIN),mingw)
ASMOBJS=i386.o
else
ASMOBJS=i386nt.obj
endif

OBJS=$(COBJS) $(ASMOBJS)

all: libasmrun.$(A)

libasmrun.$(A): $(OBJS)
	$(call MKLIB,libasmrun.$(A), $(OBJS))

i386nt.obj: i386nt.asm
	ml /nologo /coff /Cp /c /Foi386nt.obj i386nt.asm

i386.o: i386.S
	$(CC) -c -DSYS_$(SYSTEM) i386.S

install:
	cp libasmrun.$(A) $(LIBDIR)

$(LINKEDFILES): %.c: ../byterun/%.c
	cp ../byterun/$*.c $*.c

# Need special compilation rule so as not to do -I../byterun
win32.$(O): ../byterun/win32.c
	$(CC) -c $(NATIVECCCOMPOPTS) -DNATIVE_CODE ../byterun/win32.c

.SUFFIXES: .c .$(O)

.c.$(O):
	$(CC) $(CFLAGS) -c $<

clean::
	rm -f $(LINKEDFILES)

clean::
	rm -f *.$(O) *.$(A) *~

.depend.nt:
	sed -e 's/\.o/.$(O)/g' .depend > .depend.nt

include .depend.nt