include ../config/Makefile
CC=$(NATIVECC)

# LIBRARY
OROOT=../
# Note the importance of -I- to override mlvalues.h with that in this dir
CFLAGS= -I- -I $(OROOT)/natdyn  \
  -I $(OROOT)/byterun -I $(OROOT)/asmrun -DNATIVE_CODE \
	-DTARGET_$(ARCH) -DSYS_$(SYSTEM)  $(NATIVECCCOMPOPTS)

# All the source code files that use IsAtom() defined in mlvalues.h
# We have to recompile them with our mlvalues.h and our IsAtom()
IsAtomUsers= \
	array.c \
	compare.c \
	hash.c \
	instrtrace.c \
	extern.c

IsAtomSrcDir=../byterun

# we need merely mldl_prim.o so to avoid unresolved references:
# Trx refers to offshoring, and offshoring refers to mldl_prim.o
# so, once we need Trx for anything, we have to link against
# all the other stuff, whether we use it or not.
LIB_C = roots.c ndl.c $(IsAtomUsers) $(OROOT)/byterun/mldl_prim.c
LIB=libnatdyn.a

$(IsAtomUsers:.c=.o):  mlvalues.h
	$(CC) $(CFLAGS) -o $@ -c $(IsAtomSrcDir)/$(@:.o=.c)
$(LIB): $(LIB_C:.c=.o)
	ar rcv $@ $^

clean:
	rm -f *.o $(LIB) *.cmi *.cmx




syntax highlighted by Code2HTML, v. 0.9.1