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
|
## Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh
# Jagannathan, and Stephen Weeks.
#
# MLton is released under a BSD-style license.
# See the file MLton-LICENSE for details.
##
TARGET_ARCH = $(shell ../bin/host-arch)
all: interpret.o interpret-gdb.o print-opcodes
CC = gcc -std=gnu99
CFLAGS = -fomit-frame-pointer -I../runtime -I../include -Wall
DEBUGFLAGS = $(CFLAGS)
ifneq ($(TARGET_ARCH), ia64)
ifneq ($(TARGET_ARCH), powerpc)
DEBUGFLAGS += -gstabs+
endif
endif
DEBUGFLAGS += -g2
ifeq ($(TARGET_ARCH), amd64)
CFLAGS += -mtune=opteron -m32
endif
ifeq ($(TARGET_OS), freebsd)
CFLAGS += -I/usr/local/include
endif
interpret.o: interpret.c interpret.h opcode.h
$(CC) $(CFLAGS) -c -O2 interpret.c
interpret-gdb.o: interpret.c interpret.h
$(CC) $(DEBUGFLAGS) -c -o $@ -DASSERT=1 interpret.c
print-opcodes: print-opcodes.c opcode.h
$(CC) $(CFLAGS) -o print-opcodes -I../runtime -L../runtime \
print-opcodes.c -lmlton
.PHONY: clean
clean:
../bin/clean
.PHONY: exp
exp:
$(CC) -E -I../runtime -I../include interpret.c >/tmp/z.exp
|