Introduce and use ROOTDIR in more makefiles

master
Sébastien Hinderer 2018-09-17 14:51:01 +02:00
parent ba6362a07d
commit 01b65ac0af
9 changed files with 149 additions and 159 deletions

View File

@ -13,87 +13,66 @@
#* *
#**************************************************************************
include ../Makefile.config
include ../Makefile.common
ROOTDIR = ..
UNIXDIR=../otherlibs/$(UNIXLIB)
CAMLRUN ?= ../boot/ocamlrun
CAMLYACC ?= ../yacc/ocamlyacc$(EXE)
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
CAMLC=$(CAMLRUN) ../ocamlc -g -nostdlib -I ../stdlib
UNIXDIR=$(ROOTDIR)/otherlibs/$(UNIXLIB)
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc$(EXE)
CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -g -nostdlib -I $(ROOTDIR)/stdlib
COMPFLAGS=$(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \
-safe-string -strict-sequence -strict-formats
LINKFLAGS=-linkall -I $(UNIXDIR)
YACCFLAGS=
CAMLLEX=$(CAMLRUN) ../boot/ocamllex
CAMLDEP=$(CAMLRUN) ../tools/ocamldep
CAMLLEX=$(CAMLRUN) $(ROOTDIR)/boot/ocamllex
CAMLDEP=$(CAMLRUN) $(ROOTDIR)/tools/ocamldep
DEPFLAGS=$(INCLUDES)
INCLUDES=\
-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../toplevel \
-I ../driver -I $(UNIXDIR)
DIRECTORIES=$(UNIXDIR) $(addprefix $(ROOTDIR)/,\
utils parsing typing bytecomp toplevel driver)
OTHEROBJS=\
$(UNIXDIR)/unix.cma \
../utils/config.cmo ../utils/build_path_prefix_map.cmo ../utils/misc.cmo \
../utils/identifiable.cmo ../utils/numbers.cmo \
../utils/arg_helper.cmo ../utils/clflags.cmo \
../utils/consistbl.cmo ../utils/warnings.cmo \
../utils/terminfo.cmo \
../parsing/location.cmo ../parsing/longident.cmo ../parsing/docstrings.cmo \
../parsing/syntaxerr.cmo \
../parsing/ast_helper.cmo ../parsing/ast_mapper.cmo \
../parsing/ast_iterator.cmo ../parsing/attr_helper.cmo \
../parsing/builtin_attributes.cmo \
../typing/ident.cmo ../typing/path.cmo ../typing/types.cmo \
../typing/btype.cmo ../typing/primitive.cmo ../typing/typedtree.cmo \
../typing/subst.cmo ../typing/predef.cmo \
../typing/datarepr.cmo ../typing/cmi_format.cmo ../typing/env.cmo \
../typing/oprint.cmo \
../typing/ctype.cmo ../typing/printtyp.cmo ../typing/mtype.cmo \
../typing/envaux.cmo \
../bytecomp/runtimedef.cmo ../bytecomp/bytesections.cmo \
../bytecomp/dll.cmo ../bytecomp/meta.cmo ../bytecomp/symtable.cmo \
../bytecomp/opcodes.cmo ../driver/compdynlink.cmo \
../toplevel/genprintval.cmo
INCLUDES=$(addprefix -I ,$(DIRECTORIES))
utils_modules := $(addprefix utils/,\
config build_path_prefix_map misc identifiable numbers arg_helper clflags \
consistbl warnings terminfo)
OBJS=\
int64ops.cmo \
primitives.cmo \
unix_tools.cmo \
debugger_config.cmo \
parameters.cmo \
lexer.cmo \
input_handling.cmo \
question.cmo \
debugcom.cmo \
exec.cmo \
source.cmo \
pos.cmo \
checkpoints.cmo \
events.cmo \
program_loading.cmo \
symbols.cmo \
breakpoints.cmo \
trap_barrier.cmo \
history.cmo \
printval.cmo \
show_source.cmo \
time_travel.cmo \
program_management.cmo \
frames.cmo \
eval.cmo \
show_information.cmo \
loadprinter.cmo \
parser.cmo \
command_line.cmo \
main.cmo
parsing_modules := $(addprefix parsing/,\
location longident docstrings syntaxerr ast_helper ast_mapper ast_iterator \
attr_helper builtin_attributes)
typing_modules := $(addprefix typing/,\
ident path types btype primitive typedtree subst predef datarepr \
cmi_format env oprint ctype printtyp mtype envaux)
bytecomp_modules := $(addprefix bytecomp/,\
runtimedef bytesections dll meta symtable opcodes)
other_compiler_modules := \
driver/compdynlink toplevel/genprintval
compiler_modules := $(addprefix $(ROOTDIR)/,\
$(utils_modules) $(parsing_modules) $(typing_modules) \
$(bytecomp_modules) $(other_compiler_modules))
debugger_modules := \
int64ops primitives unix_tools debugger_config parameters lexer \
input_handling question debugcom exec source pos checkpoints events \
program_loading symbols breakpoints trap_barrier history printval \
show_source time_travel program_management frames eval \
show_information loadprinter parser command_line main
all_modules := $(compiler_modules) $(debugger_modules)
all_objects := $(addsuffix .cmo,$(all_modules))
all: ocamldebug$(EXE)
ocamldebug$(EXE): $(OBJS) $(OTHEROBJS)
$(CAMLC) $(LINKFLAGS) -o ocamldebug$(EXE) -linkall $(OTHEROBJS) $(OBJS)
ocamldebug$(EXE): $(UNIXDIR)/unix.cma $(all_objects)
$(CAMLC) $(LINKFLAGS) -o $@ -linkall $^
install:
$(INSTALL_PROG) ocamldebug$(EXE) "$(INSTALL_BINDIR)/ocamldebug$(EXE)"

View File

@ -12,8 +12,10 @@
#* *
#**************************************************************************
include ../Makefile.config
include ../Makefile.common
ROOTDIR = ..
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
# Files to install
FILES= caml-font.el caml-hilit.el caml.el camldebug.el \

View File

@ -13,7 +13,8 @@
#* *
#**************************************************************************
include ../Makefile.config
ROOTDIR = ..
include $(ROOTDIR)/Makefile.config
INSTALL_DIR=$(DESTDIR)$(MANDIR)/man$(PROGRAMS_MAN_SECTION)

View File

@ -17,18 +17,19 @@
# FIXME reduce redundancy by including ../Makefile
include ../../Makefile.config
include ../../Makefile.common
ROOTDIR = ../..
CAMLRUN ?= ../../boot/ocamlrun
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
ROOTDIR = ../..
OCAMLC = $(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib
OCAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib
INCLUDES=-I ../../utils -I ../../typing -I ../../bytecomp -I ../../asmcomp
INCLUDES=$(addprefix -I $(ROOTDIR)/,utils typing bytecomp asmcomp)
COMPFLAGS=$(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -bin-annot -g \
-I ../../stdlib -warn-error A \
-I $(ROOTDIR)/stdlib -warn-error A \
-safe-string -strict-sequence -strict-formats
ifeq "$(FLAMBDA)" "true"
OPTCOMPFLAGS=-O3
@ -38,29 +39,21 @@ endif
OBJS=dynlinkaux.cmo dynlink.cmo
COMPILEROBJS=\
../../utils/config.cmo ../../utils/build_path_prefix_map.cmo \
../../utils/misc.cmo \
../../utils/identifiable.cmo ../../utils/numbers.cmo \
../../utils/arg_helper.cmo ../../utils/clflags.cmo \
../../utils/consistbl.cmo \
../../utils/terminfo.cmo ../../utils/warnings.cmo \
../../parsing/asttypes.cmi \
../../parsing/location.cmo ../../parsing/longident.cmo \
../../parsing/docstrings.cmo ../../parsing/syntaxerr.cmo \
../../parsing/ast_helper.cmo \
../../parsing/ast_mapper.cmo ../../parsing/ast_iterator.cmo \
../../parsing/attr_helper.cmo \
../../parsing/builtin_attributes.cmo \
../../typing/ident.cmo ../../typing/path.cmo \
../../typing/primitive.cmo ../../typing/types.cmo \
../../typing/btype.cmo ../../typing/subst.cmo ../../typing/predef.cmo \
../../typing/datarepr.cmo ../../typing/cmi_format.cmo ../../typing/env.cmo \
../../bytecomp/lambda.cmo ../../bytecomp/instruct.cmo \
../../bytecomp/cmo_format.cmi ../../bytecomp/opcodes.cmo \
../../bytecomp/runtimedef.cmo ../../bytecomp/bytesections.cmo \
../../bytecomp/dll.cmo ../../bytecomp/meta.cmo \
../../bytecomp/symtable.cmo
COMPILEROBJS = $(addprefix $(ROOTDIR)/,\
utils/config.cmo utils/build_path_prefix_map.cmo utils/misc.cmo \
utils/identifiable.cmo utils/numbers.cmo utils/arg_helper.cmo \
utils/clflags.cmo utils/consistbl.cmo \
utils/terminfo.cmo utils/warnings.cmo \
parsing/asttypes.cmi parsing/location.cmo parsing/longident.cmo \
parsing/docstrings.cmo parsing/syntaxerr.cmo \
parsing/ast_helper.cmo parsing/ast_mapper.cmo parsing/ast_iterator.cmo \
parsing/attr_helper.cmo parsing/builtin_attributes.cmo \
typing/ident.cmo typing/path.cmo typing/primitive.cmo typing/types.cmo \
typing/btype.cmo typing/subst.cmo typing/predef.cmo \
typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo \
bytecomp/lambda.cmo bytecomp/instruct.cmo bytecomp/cmo_format.cmi \
bytecomp/opcodes.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
bytecomp/dll.cmo bytecomp/meta.cmo bytecomp/symtable.cmo)
NATOBJS=dynlink.cmx
@ -69,15 +62,13 @@ all: dynlink.cma extract_crc
allopt: dynlink.cmxa
dynlink.cma: $(OBJS)
$(OCAMLC) $(COMPFLAGS) -ccopt "$(NATDYNLINKOPTS)" -a -o dynlink.cma \
$(OBJS)
$(OCAMLC) $(COMPFLAGS) -ccopt "$(NATDYNLINKOPTS)" -a -o $@ $^
dynlink.cmxa: $(NATOBJS)
$(OCAMLOPT) $(COMPFLAGS) -ccopt "$(NATDYNLINKOPTS)" -a -o dynlink.cmxa \
$(NATOBJS)
$(OCAMLOPT) $(COMPFLAGS) -ccopt "$(NATDYNLINKOPTS)" -a -o $@ $^
dynlinkaux.cmo: $(COMPILEROBJS)
$(OCAMLC) $(COMPFLAGS) -pack -o dynlinkaux.cmo $(COMPILEROBJS)
$(OCAMLC) $(COMPFLAGS) -pack -o $@ $^
dynlinkaux.cmi: dynlinkaux.cmo
@ -87,7 +78,7 @@ dynlink.cmx: dynlink.cmi natdynlink.ml
rm -f dynlink.mlopt
extract_crc: dynlink.cma extract_crc.cmo
$(OCAMLC) -o extract_crc dynlink.cma extract_crc.cmo
$(OCAMLC) -o $@ $^
install:
$(INSTALL_DATA) \

View File

@ -15,24 +15,25 @@
# FIXME reduce redundancy by including ../Makefile
include ../../Makefile.config
include ../../Makefile.common
ROOTDIR = ../..
CAMLRUN ?= ../../boot/ocamlrun
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
OC_CFLAGS += $(SHAREDLIB_CFLAGS)
OC_CPPFLAGS += -I../../runtime
ROOTDIR=../..
OC_CPPFLAGS += -I$(ROOTDIR)/runtime
CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib \
-I $(ROOTDIR)/stdlib -I $(ROOTDIR)/otherlibs/unix
MKLIB=$(CAMLRUN) ../../tools/ocamlmklib
MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlmklib
COMPFLAGS=-w +33..39 -warn-error A -bin-annot -g -safe-string
C_OBJS=scheduler.o
CAML_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
LIB=../../stdlib
LIB=$(ROOTDIR)/stdlib
# Object file prefix
P=stdlib__
@ -69,13 +70,13 @@ libvmthreads.a: $(C_OBJS)
$(MKLIB) -o threads -oc vmthreads $(C_OBJS)
threads.cma: $(CAML_OBJS)
$(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS)
$(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $^
stdlib.cma: $(LIB_OBJS)
$(CAMLC) -a -o stdlib.cma $(LIB_OBJS)
$(CAMLC) -a -o $@ $^
unix.cma: $(UNIXLIB_OBJS)
$(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $(UNIXLIB_OBJS)
$(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $^
stdlib.cmo: stdlib.mli stdlib.cmi stdlib.ml
$(CAMLC) ${COMPFLAGS} -nopervasives \
@ -85,23 +86,23 @@ stdlib.mli: $(LIB)/stdlib.mli
ln -s $(LIB)/stdlib.mli stdlib.mli
stdlib.cmi: $(LIB)/stdlib.cmi
rm -f stdlib.cmi
ln -s $(LIB)/stdlib.cmi stdlib.cmi
rm -f $@
ln -s $< $@
$(P)marshal.cmo: marshal.mli $(P)marshal.cmi marshal.ml
$(CAMLC) ${COMPFLAGS} -o$@ -c marshal.ml
$(P)marshal.cmo: marshal.ml marshal.mli $(P)marshal.cmi
$(CAMLC) ${COMPFLAGS} -o$@ -c $<
marshal.mli: $(LIB)/marshal.mli
ln -s $(LIB)/marshal.mli marshal.mli
ln -s $< $@
$(P)marshal.cmi: $(LIB)/$(P)marshal.cmi
ln -s $(LIB)/$(P)marshal.cmi $(P)marshal.cmi
ln -s $< $@
unix.mli: $(UNIXLIB)/unix.mli
ln -s -f $(UNIXLIB)/unix.mli unix.mli
ln -s -f $< $@
unix.cmi: $(UNIXLIB)/unix.cmi
ln -s -f $(UNIXLIB)/unix.cmi unix.cmi
ln -s -f $< $@
unix.cmo: unix.mli unix.cmi $(UNIXLIB)/unixLabels.cmo
$(CAMLC) ${COMPFLAGS} -c unix.ml

View File

@ -13,8 +13,10 @@
#* *
#**************************************************************************
include ../Makefile.config
include ../Makefile.common
ROOTDIR = ..
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
# Lists of source files
@ -167,7 +169,7 @@ OC_PROF_CFLAGS=-pg
OC_PROF_CPPFLAGS=-DPROFILING
endif
ASPPFLAGS = -DSYS_$(SYSTEM) -I../runtime
ASPPFLAGS = -DSYS_$(SYSTEM) -I$(ROOTDIR)/runtime
ifeq "$(UNIX_OR_WIN32)" "unix"
ASPPFLAGS += -DMODEL_$(MODEL)
endif
@ -224,7 +226,7 @@ distclean: clean
# Generated non-object files
ld.conf: ../Makefile.config
ld.conf: $(ROOTDIR)/Makefile.config
echo "$(STUBLIBDIR)" > $@
echo "$(LIBDIR)" >> $@
@ -277,8 +279,8 @@ caml/jumptbl.h : caml/instruct.h
sed -n -e '/^ /s/ \([A-Z]\)/ \&\&lbl_\1/gp' \
-e '/^}/q' > $@
caml/version.h : ../VERSION ../tools/make-version-header.sh
../tools/make-version-header.sh ../VERSION > caml/version.h
caml/version.h : $(ROOTDIR)/tools/make-version-header.sh $(ROOTDIR)/VERSION
$^ > $@
# Libraries and programs

View File

@ -13,13 +13,15 @@
#* *
#**************************************************************************
include ../Makefile.config
include ../Makefile.common
ROOTDIR = ..
CAMLRUN ?= ../boot/ocamlrun
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
TARGET_BINDIR ?= $(BINDIR)
COMPILER=../ocamlc
COMPILER=$(ROOTDIR)/ocamlc
CAMLC=$(CAMLRUN) $(COMPILER)
COMPFLAGS=-strict-sequence -absname -w +a-4-9-41-42-44-45-48 \
-g -warn-error A -bin-annot -nostdlib \
@ -29,9 +31,11 @@ OPTCOMPFLAGS=-O3
else
OPTCOMPFLAGS=
endif
OPTCOMPILER=../ocamlopt
OPTCOMPILER=$(ROOTDIR)/ocamlopt
CAMLOPT=$(CAMLRUN) $(OPTCOMPILER)
CAMLDEP=$(CAMLRUN) ../tools/ocamldep
CAMLDEP=$(CAMLRUN) $(ROOTDIR)/tools/ocamldep
OC_CPPFLAGS += -I$(ROOTDIR)/runtime
# Object file prefix
P=stdlib__
@ -150,7 +154,7 @@ CAMLHEADERS =\
camlheaderi target_camlheaderi
ifeq "$(HASHBANGSCRIPTS)" "true"
$(CAMLHEADERS): ../Makefile.config
$(CAMLHEADERS): $(ROOTDIR)/Makefile.config
for suff in '' d i; do \
echo '#!$(BINDIR)/ocamlrun'$$suff > camlheader$$suff && \
echo '#!$(TARGET_BINDIR)/ocamlrun'$$suff >target_camlheader$$suff; \
@ -158,17 +162,17 @@ $(CAMLHEADERS): ../Makefile.config
echo '#!' | tr -d '\012' > camlheader_ur;
else # Hashbang scripts not supported
$(CAMLHEADERS): $(HEADERPROGRAM) ../Makefile.config
$(CAMLHEADERS): $(HEADERPROGRAM) $(ROOTDIR)/Makefile.config
ifeq "$(UNIX_OR_WIN32)" "unix"
$(CAMLHEADERS):
for suff in '' d i; do \
$(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I../runtime $(OC_LDFLAGS) \
$(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) $(OC_LDFLAGS) \
-DRUNTIME_NAME='"$(BINDIR)/ocamlrun'$$suff'"' \
header.c $(OUTPUTEXE)tmpheader$(EXE) && \
strip tmpheader$(EXE) && \
mv tmpheader$(EXE) camlheader$$suff && \
$(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I../runtime $(OC_LDFLAGS) \
$(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) $(OC_LDFLAGS) \
-DRUNTIME_NAME='"$(TARGET_BINDIR)/ocamlrun'$$suff'"' \
header.c $(OUTPUTEXE)tmpheader$(EXE) && \
strip tmpheader$(EXE) && \
@ -182,7 +186,7 @@ else # Windows
# with those above
camlheader: headernt.c
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I../runtime \
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) \
-DRUNTIME_NAME='"ocamlrun"' $(OUTPUTOBJ)headernt.$(O) $<
$(MKEXE) -o tmpheader.exe headernt.$(O) $(EXTRALIBS)
rm -f camlheader.exe
@ -195,7 +199,7 @@ camlheader_ur: camlheader
cp camlheader camlheader_ur
camlheaderd: headernt.c
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I../runtime \
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) \
-DRUNTIME_NAME='"ocamlrund"' $(OUTPUTOBJ)headerntd.$(O) $<
$(MKEXE) -o tmpheaderd.exe headerntd.$(O) $(EXTRALIBS)
mv tmpheaderd.exe camlheaderd
@ -204,7 +208,7 @@ target_camlheaderd: camlheaderd
cp camlheaderd target_camlheaderd
camlheaderi: headernt.c
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I../runtime \
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) \
-DRUNTIME_NAME='"ocamlruni"' $(OUTPUTOBJ)headernti.$(O) $<
$(MKEXE) -o tmpheaderi.exe headernti.$(O) $(EXTRALIBS)
mv tmpheaderi.exe camlheaderi
@ -228,8 +232,8 @@ stdlib.cmxa: $(OBJS:.cmo=.cmx)
stdlib.p.cmxa: $(OBJS:.cmo=.p.cmx)
$(CAMLOPT) -a -o $@ $^
sys.ml: sys.mlp ../VERSION
sed -e "s|%%VERSION%%|`sed -e 1q ../VERSION | tr -d '\r'`|" sys.mlp > $@
sys.ml: $(ROOTDIR)/VERSION sys.mlp
sed -e "s|%%VERSION%%|`sed -e 1q $< | tr -d '\r'`|" sys.mlp > $@
.PHONY: clean
clean::

View File

@ -12,15 +12,17 @@
#* *
#**************************************************************************
BASEDIR=..
include $(BASEDIR)/../Makefile.config
BASEDIR = ..
ROOTDIR = ../..
include $(ROOTDIR)/Makefile.config
expect_MAIN=expect_test
expect_PROG=$(expect_MAIN)$(EXE)
expect_COMPFLAGS=-I $(OTOPDIR)/parsing -I $(OTOPDIR)/utils \
-I $(OTOPDIR)/driver -I $(OTOPDIR)/typing -I $(OTOPDIR)/toplevel
expect_LIBRARIES=../../compilerlibs/ocamlcommon \
../../compilerlibs/ocamlbytecomp \
../../compilerlibs/ocamltoplevel
expect_LIBRARIES := $(addprefix $(ROOTDIR)/compilerlibs/,\
ocamlcommon ocamlbytecomp ocamltoplevel)
codegen_INCLUDES=\
-I $(OTOPDIR)/parsing \

View File

@ -15,11 +15,19 @@
# Makefile for the parser generator.
include ../Makefile.config
ROOTDIR = ..
OBJS= closure.$(O) error.$(O) lalr.$(O) lr0.$(O) main.$(O) \
mkpar.$(O) output.$(O) reader.$(O) \
skeleton.$(O) symtab.$(O) verbose.$(O) warshall.$(O)
include $(ROOTDIR)/Makefile.config
OC_CPPFLAGS += -I$(ROOTDIR)/runtime
ocamlyacc_SOURCES := $(addsuffix .c,\
closure error lalr lr0 main mkpar output reader skeleton symtab verbose \
warshall)
ocamlyacc_OBJECTS := $(ocamlyacc_SOURCES:.c=.$(O))
generated_files := ocamlyacc$(EXE) $(ocamlyacc_OBJECTS) version.h
all: ocamlyacc$(EXE)
@ -27,14 +35,14 @@ ifeq ($(TOOLCHAIN),cc)
MKEXE_ANSI=$(MKEXE)
endif
ocamlyacc$(EXE): $(OBJS)
$(MKEXE_ANSI) -o ocamlyacc$(EXE) $(OBJS) $(EXTRALIBS)
ocamlyacc$(EXE): $(ocamlyacc_OBJECTS)
$(MKEXE_ANSI) -o $@ $^ $(EXTRALIBS)
version.h : ../VERSION
echo "#define OCAML_VERSION \"`sed -e 1q $^ | tr -d '\r'`\"" > $@
version.h : $(ROOTDIR)/VERSION
echo "#define OCAML_VERSION \"`sed -e 1q $< | tr -d '\r'`\"" > $@
clean:
rm -f *.$(O) ocamlyacc$(EXE) *~ version.h
rm -f $(generated_files)
depend:
@ -55,4 +63,4 @@ warshall.$(O): defs.h
# also works for .obj files.
%.$(O): %.c
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I../runtime $(OUTPUTOBJ)$@ $<
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<