# mk.x86-freebsd
#
# makefile for "Free BSD", which is a BSD 4.4 clone.
#

SHELL =		/bin/sh

MAKE =		gmake

ARFLAGS =	Trcv
CC =		gcc -ansi
CFLAGS =	-O2
CPP =		gcc -x assembler-with-cpp -E -P 
#CPP =		/usr/bin/cpp -P

XOBJS =
XLIBS =		../c-libs/dl/libunix-dynload.a
LD_LIBS =
BASE_DEFS =
DEFS =		$(BASE_DEFS) -DHOST_X86 -DTARGET_X86 -DOPSYS_UNIX -DOPSYS_FREEBSD -DDLOPEN
TARGET =	X86
VERSION =	v-x86-freebsd
RUNTIME =	run.x86-freebsd
RUNTIME_SO =	run.x86-freebsd.so
RUNTIME_A =	run.x86-freebsd.a

all:
	($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
	($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO))
	($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A))
