There is no rule to make the target `/ Makefile 'needed by the` Makefile'

I am trying to do using a fairly simple makefile. My makefile is called a "Makefile", so I just use the "make" command.

I get this strange error:
make: *** No rule to make target `/Makefile', needed by `Makefile'. Stop.

If, however, I use make -f "full-path-to-makefile"it really works (with odd consequences ...). I have to say that I run all this from the directory where the Makefile is located.

I am working on Mac OSX using tcsh.

Edit:

I work in an LLVM environment trying to compile the pass function, and this is the associated make file:

LEVEL = ../../../
LIBRARYNAME = FunctionName
LOADABLE_MODULE = 1
include $ (LEVEL) /Makefile.common

Any ideas would be appreciated :)

+3
source share
7

, :

LLVM. , , , . , , , ( , Makefile, make).

, , , :)

, , :.configure, ( , -). .

BTW - , Ubuntu ( ).

+1

, LLVM i, , HelloB ( Hello exsited) http://llvm.org/docs/WritingAnLLVMPass.html#quickstart

, . /configure, .

+2

: . $(LEVEL).

+1

( , Google ). , ( ) LLVM OSX realpath make.

, , "LLVM/llvm-2.9-build", - PROJECT_OBJ_ROOT Makefile.config , "LLVM/LLVM-2,9-". OSX , , , LLVM_SRC_ROOT "LLVM/llvm-2.9-build". , PROJ_SRC_DIR patsubst ( , ), , , / realpath.

PROJ_SRC_DIR, /, makefile Makefile.rules, , make $(PROJ_SRC_DIR)/Makefile (ie/Makefile) .

, realpath Make (GNU Make 3.81 ), , realpath Makefile.config . , LLVM.

, , realpath "llvm", , , , , - , , . , "LLVM" , , , , .

, , !

+1

, , , gmake, Makefile, , , , , .

, Makefile, , , , , Makefile.common. , $( )/Makefile . gmake -d .

0

:

include $(LEVEL)/Makefile.common

, /Makefile.common. , , , , LEVEL.

Makefile.common, $(SOMEMACRO)/Makefile, SOMEMACRO?

0

here are my fixes for this problem: ( https://github.com/rust-lang/rust/issues/24887#issuecomment-99391849 )

update src / llvm / Makefile.config.in before starting. / configure

or update x86_64-apple-darwin / llvm / Makefile.config before doing

line 59:

PROJ_SRC_DIR    := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))

upgrade to

PROJ_SRC_DIR    := $(patsubst $(PROJ_OBJ_ROOT)%,$(LLVM_SRC_ROOT)%,$(PROJ_OBJ_DIR))

line 86:

PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))

upgrade to

PROJ_SRC_DIR := $(call realpath, $(patsubst $(PROJ_OBJ_ROOT)%,$(PROJ_SRC_ROOT)%,$(PROJ_OBJ_DIR)))
0
source

Source: https://habr.com/ru/post/1787005/


All Articles