In the orbitToolsDemo folder is a project:

mkf // интересует этот makefile ./orbitTools/core: cEci.cpp cJulian.cpp coord.cpp coreLib.h cSite.h cTLE.h cVector.h globals.cpp stdafx.h cEci.h cJulian.h coord.h cSite.cpp cTLE.cpp cVector.cpp exceptions.h globals.h stdafx.cpp ./orbitTools/orbit: cNoradBase.cpp cNoradSDP4.cpp cNoradSGP4.cpp cOrbit.cpp cSatellite.cpp orbitLib.h stdafx.cpp cNoradBase.h cNoradSDP4.h cNoradSGP4.h cOrbit.h cSatellite.h stdafx.h ./orbitToolsDemo: main.cpp resource.h stdafx.cpp stdafx.h 

I quote mkf:

 CC=g++ CFLAGS=-c -Wall -std=c++1y PATH_CORE=./orbitTools/core/ PATH_ORBIT=./orbitTools/orbit/ .PHONY : all clean install all : orbit orbit : cEci.o cJulian.o coord.o cSite.o cTLE.o cVector.o globals.o \ cNoradBase.o cNoradSDP4.o cNoradSGP4.o cOrbit.o cSatellite.o \ main.o stdafx.o g++ cEci.o cJulian.o coord.o cSite.o cTLE.o cVector.o globals.o \ cNoradBase.o cNoradSDP4.o cNoradSGP4.o cOrbit.o cSatellite.o \ main.o stdafx.o -o orbit clean : rm -rf *.o orbit cEci.o : $(PATH_CORE)cEci.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)cEci.cpp cJulian.o : $(PATH_CORE)cJulian.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)cJulian.cpp coord.o : $(PATH_CORE)coord.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)coord.cpp cSite.o : $(PATH_CORE)cSite.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)cSite.cpp cTLE.o : $(PATH_CORE)cTLE.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)cTLE.cpp cVector.o : $(PATH_CORE)cVector.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)cVector.cpp globals.o : $(PATH_CORE)globals.cpp $(PATH_CORE)stdafx.h g++ $(CFLAGS) $(PATH_CORE)globals.cpp cNoradBase.o : $(PATH_ORBIT)cNoradBase.cpp $(PATH_ORBIT)stdafx.h g++ $(CFLAGS) $(PATH_ORBIT)cNoradBase.cpp cNoradSDP4.o : $(PATH_ORBIT)cNoradSDP4.cpp $(PATH_ORBIT)stdafx.h g++ $(CFLAGS) $(PATH_ORBIT)cNoradSDP4.cpp cNoradSGP4.o : $(PATH_ORBIT)cNoradSGP4.cpp $(PATH_ORBIT)stdafx.h g++ $(CFLAGS) $(PATH_ORBIT)cNoradSGP4.cpp cOrbit.o : $(PATH_ORBIT)cOrbit.cpp $(PATH_ORBIT)stdafx.h g++ $(CFLAGS) $(PATH_ORBIT)cOrbit.cpp cSatellite.o : $(PATH_ORBIT)cSatellite.cpp $(PATH_ORBIT)stdafx.h g++ $(CFLAGS) $(PATH_ORBIT)cSatellite.cpp main.o : ./orbitToolsDemo/main.cpp ./orbitToolsDemo/stdafx.h g++ $(CFLAGS) ./orbitToolsDemo/main.cpp stdafx.o : ./orbitToolsDemo/stdafx.cpp #./orbitTools/core/coreLib.h ./orbitTools/orbit/orbitLib.h g++ $(CFLAGS) ./orbitToolsDemo/stdafx.cpp install: install ./orbit /home/tree_js 

everything is going, it starts ... however, make clean and make install do not work:

make clean

make install

, they say, "there is no rule for building a clean target". What's wrong?

make version: GNU Make 3.82

OS version: Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC))

  • 1. Please give the complete command to which you get the answer “there is no rule for ...” and indicate in which directory you run it. 2. Please provide the version of the make program being used. 3. Please indicate the distribution name of your operating system. - aleksandr barakin
  • if the given file is called mkf , then gnu / make does not use it. - aleksandr barakin
  • Well, the project is going, everything is fine ... or are you talking about - xperious
  • Maybe there is another makefile or Makefile ? Actually, for mkf you need to call make -f mkf ... - avp
  • @xperious, I’m saying that this file is either not used at all, or is called ( not connected by the include directive) from another file. in which there are no clean and install goals. - aleksandr barakin 10:51 pm

1 answer 1

the gnu / make program, if it does not specify a file with rules, tries to use such file names (in that order): GNUmakefile , makefile and Makefile .

There is probably a file with one of the names listed above in the directory where you run gnu / make .

and the file with the name mkf not used (by default).

in order to specify a specific file, you can pass the -f имя_файла option to the gnu / make program. eg:

 $ make -f mkf clean 
  • thank you all ... yes, I had to make -f mkf clean ... like nonsense, but I couldn’t google myself - xperious
  • @xperious, if you are given an exhaustive answer, please mark it with the accepted ("tick") to the left of the answer. - aleksandr barakin