Use $(addprefix ...) and spacing adjustments

master
David Allsopp 2018-07-27 11:35:09 +01:00
parent 4756a576f0
commit ad07b6d9b5
5 changed files with 25 additions and 29 deletions

View File

@ -15,7 +15,7 @@
# The main Makefile
ROOTDIR=.
ROOTDIR = .
include config/Makefile
include Makefile.common
@ -289,7 +289,7 @@ ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
FLEXDLL_DIR =
else
BOOT_FLEXLINK_CMD = FLEXLINK_CMD="../boot/ocamlrun ../flexdll/flexlink.exe"
FLEXDLL_DIR=$(if $(wildcard flexdll/flexdll_*.$(O)),+flexdll)
FLEXDLL_DIR = $(if $(wildcard flexdll/flexdll_*.$(O)),+flexdll)
endif
else
FLEXDLL_DIR =

View File

@ -15,7 +15,7 @@
# The lexer generator
ROOTDIR=..
ROOTDIR = ..
include $(ROOTDIR)/config/Makefile
include $(ROOTDIR)/Makefile.common
@ -23,15 +23,15 @@ include $(ROOTDIR)/Makefile.common
CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun
CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc
CAMLC=$(CAMLRUN) $(ROOTDIR)/boot/ocamlc -strict-sequence -nostdlib \
-I $(ROOTDIR)/boot -use-prims $(ROOTDIR)/runtime/primitives
CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -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 -bin-annot
LINKFLAGS=
YACCFLAGS=-v
CAMLLEX=$(CAMLRUN) $(ROOTDIR)/boot/ocamllex
CAMLDEP=$(CAMLRUN) $(ROOTDIR)/tools/ocamldep
CAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc -strict-sequence -nostdlib \
-I $(ROOTDIR)/boot -use-prims $(ROOTDIR)/runtime/primitives
CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -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 -bin-annot
LINKFLAGS =
YACCFLAGS = -v
CAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex
CAMLDEP = $(CAMLRUN) $(ROOTDIR)/tools/ocamldep
OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo \

View File

@ -15,7 +15,7 @@
# The Makefile for ocamltest
ROOTDIR=..
ROOTDIR = ..
include $(ROOTDIR)/config/Makefile
include $(ROOTDIR)/Makefile.common
@ -147,8 +147,7 @@ bytecode_modules := $(o_files) $(cmo_files)
native_modules := $(o_files) $(cmx_files)
directories := $(ROOTDIR)/utils $(ROOTDIR)/parsing $(ROOTDIR)/stdlib \
$(ROOTDIR)/compilerlibs
directories := $(addprefix $(ROOTDIR)/,utils parsing stdlib compilerlibs)
include_directories := $(addprefix -I , $(directories))

View File

@ -35,7 +35,7 @@ else # Windows
ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
FLEXLINK_ENV =
else
ROOT:=$(shell cd .. && pwd| cygpath -m -f -)
ROOT := $(shell cd .. && pwd| cygpath -m -f -)
# FLEXLINK_ENV must have a space at the end
FLEXLINK_ENV = \
OCAML_FLEXLINK="$(ROOT)/boot/ocamlrun $(ROOT)/flexdll/flexlink.exe" #

View File

@ -14,7 +14,7 @@
#**************************************************************************
MAKEFLAGS := -r -R
ROOTDIR=..
ROOTDIR = ..
include $(ROOTDIR)/config/Makefile
include $(ROOTDIR)/Makefile.common
@ -73,17 +73,15 @@ $(eval $(call \
byte_and_opt_,$(subst $$,$$$$,$1),$(subst $$,$$$$,$2),$(subst $$,$$$$,$3)))
endef
CAMLC=$(CAMLRUN) $(ROOTDIR)/boot/ocamlc -g -nostdlib -I $(ROOTDIR)/boot \
-use-prims $(ROOTDIR)/runtime/primitives -I $(ROOTDIR)
CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -g -nostdlib -I $(ROOTDIR)/stdlib
CAMLLEX=$(CAMLRUN) $(ROOTDIR)/boot/ocamllex
INCLUDES=-I $(ROOTDIR)/utils -I $(ROOTDIR)/parsing -I $(ROOTDIR)/typing \
-I $(ROOTDIR)/bytecomp -I $(ROOTDIR)/asmcomp -I $(ROOTDIR)/middle_end \
-I $(ROOTDIR)/middle_end/base_types -I $(ROOTDIR)/driver \
-I $(ROOTDIR)/toplevel
COMPFLAGS= -absname -w +a-4-9-41-42-44-45-48 -strict-sequence -warn-error A \
CAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc -g -nostdlib -I $(ROOTDIR)/boot \
-use-prims $(ROOTDIR)/runtime/primitives -I $(ROOTDIR)
CAMLOPT = $(CAMLRUN) $(ROOTDIR)/ocamlopt -g -nostdlib -I $(ROOTDIR)/stdlib
CAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex
INCLUDES = $(addprefix -I $(ROOTDIR)/,utils parsing typing bytecomp asmcomp \
middle_end middle_end/base_types driver toplevel)
COMPFLAGS = -absname -w +a-4-9-41-42-44-45-48 -strict-sequence -warn-error A \
-safe-string -strict-formats -bin-annot $(INCLUDES)
LINKFLAGS=$(INCLUDES)
LINKFLAGS = $(INCLUDES)
VPATH := $(filter-out -I,$(INCLUDES))
# scrapelabels addlabels
@ -398,8 +396,7 @@ CAMLTEX= $(ROOTDIR)/compilerlibs/ocamlcommon.cma \
#Scan latex files, and run ocaml code examples
caml-tex: INCLUDES+= -I $(ROOTDIR)/otherlibs/str \
-I $(ROOTDIR)/otherlibs/$(UNIXLIB)
caml-tex: INCLUDES += $(addprefix -I $(ROOTDIR)/otherlibs/,str $(UNIXLIB))
caml-tex: $(CAMLTEX)
$(ROOTDIR)/runtime/ocamlrun $(ROOTDIR)/ocamlc -nostdlib \
-I $(ROOTDIR)/stdlib $(LINKFLAGS) -linkall \