Sponsored Content
Top Forums Programming Makefile No rule to make target Post 302887415 by kristinu on Friday 7th of February 2014 11:15:18 AM
Old 02-07-2014
Makefile No rule to make target

I am trying to create a makefile to build a program and am getting the following error:

Code:
make -f tsimplex.mk
make: *** No rule to make target `/main/tsimplex_main.cpp', needed by `tsimplex_main.o'.  Stop.

Code:
OPSYS = $(shell uname -s )

TARGET = tsimplex

ROOTDIR = ../../..
GTSDIR = $(ROOTDIR)/tomso/
OBJDIR = $(ROOTDIR)/tools/release/obj
BINDIR = $(ROOTDIR)/tools/release/bin

MAINDIR = $(SRCDIR)/main

# C++ compiler
CPP_COMP = g++

# C++ compiler options
CPP_OPTS = -I$(ROOTDIR)/ -O3  -Wno-non-template-friend -Wno-deprecated -DNDEBUG

# Directories

LIBINC = $(GTSDIR)/parse/loglev.hpp       \
    $(GTSDIR)/parse/parse.hpp             \
    $(GTSDIR)/parse/prargs.hpp            \
    $(GTSDIR)/parse/errors.hpp            \
    $(GTSDIR)/algeb/numeric.hpp           \
    $(GTSDIR)/optim/simplex.hpp           \
    $(GTSDIR)/tomog/tomog.hpp             \
    $(GTSDIR)/main/help/tsimplex_help.hpp 

LIBSRC = $(SRCDIR)/algeb/impl/cpp/vect.cpp     \
    $(SRCDIR)/algeb/impl/vector.ipp            \
    $(SRCDIR)/tomog/impl/tomog.ipp             \
    $(SRCDIR)/parse/impl/parse.ipp             \
    $(SRCDIR)/optim/impl/simplex.ipp           \
    $(SRCDIR)/algeb/impl/matrix.ipp            \
    $(SRCDIR)/parse/impl/cpp/string.cpp        \
    $(SRCDIR)/raytr/impl/cpp/layer.cpp         \
    $(SRCDIR)/raytr/impl/cpp/layintfclinr.cpp  \
    $(SRCDIR)/raytr/impl/cpp/laymodellinr.cpp  \
    $(SRCDIR)/raytr/impl/cpp/velmod.cpp        \
    $(SRCDIR)/main/help/impl/tsimplex_help.cpp

.PHONY : help

$(TARGET) : tsimplex_main.o error.o numeric.o
    $(CPP_COMP) -o $(TARGET) tsimplex_main.o numeric.o error.o

tsimplex_main.o : $(MAINDIR)/tsimplex_main.cpp
    g++ $(CPP_OPTS) -c $(MAINDIR)/tsimplex_main.cpp

tomog.o : $(SRCDIR)/tomog/impl/cpp/tomog.cpp
    g++ $(CPP_OPTS) -c $(SRCDIR)/tomog/impl/cpp/tomog.cpp

numeric.o : $(SRCDIR)/algeb/numeric.cpp
    g++ $(CPP_OPTS) -c $(SRCDIR)/algeb/numeric.cpp

error.o : $(SRCDIR)/parse/impl/cpp/error.cpp
    g++ $(CPP_OPTS) -c $(SRCDIR)/parse/impl/cpp/error.cpp

tsimplex_help.o : $(MAINDIR)/help/impl/cpp/tsimplex_help.cpp $(INCDIR)/parse/prargs.hpp
    g++ $(CPP_OPTS) -c $(MAINDIR)/help/impl/cpp/tsimplex_help.cpp

prargs.o : $(SRCDIR)/parse/impl/cpp/prargs.cpp $(INCDIR)/parse/prargs.hpp $(INCDIR)/algeb/vect2.hpp
    g++ $(CPP_OPTS) -c $(SRCDIR)/parse/impl/cpp/prargs.cpp

loglev.o : $(SRCDIR)/parse/impl/cpp/loglev.cpp $(INCDIR)/parse/loglev.hpp
    g++ $(CPP_OPTS) -c $(SRCDIR)/parse/impl/cpp/loglev.cpp

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

make and clean in a single rule in the makefile.

Hi, This stems from the following thread https://www.unix.com/showthread.php?t=18299 I have a makefile which makes either executables or a shared library. i.e. make -f unix.mak will create the executables and make -f unix.mak libolsv will create the shared library. Since these have to be... (4 Replies)
Discussion started by: vino
4 Replies

2. Solaris

Makefile:57: *** multiple target patterns. Stop.

Hi, I am getting the following error while building on Solaris 64 , while I am trying to build. Error Snippet :- ---------------------- Makefile:57: *** multiple target patterns. Stop. make: Leaving directory `/work1/patch/vds6053sun64o/vobs/jvi' make: *** Error 2 make: Leaving directory... (0 Replies)
Discussion started by: nileshborate
0 Replies

3. Shell Programming and Scripting

Makefile debug target

Hello, I'm having a problem with a makefile script i'm trying to write. I want to compile a C++ program in two possible ways: "make" (default target, main) and "make debug". When i supply the debug target, exactly the same as main should be built, but then with the DEBUG flag (-g -D... (2 Replies)
Discussion started by: StevenR
2 Replies

4. Programming

Makefile: multiple target variable substitution

Greetings! Basically, I would like to properly handle this with gnu make: alltools: my_tool mysecond_tool mythird_tool etc_tool %_tool: dir1/%_tool.vf dir2/%_tool/subdir2/%_tool.ver <tab>@echo done %.vf: <tab>RUN_VF $* %.ver: <tab>RUN_VER $* So, if I were to do something like:... (0 Replies)
Discussion started by: Harlinator
0 Replies

5. Shell Programming and Scripting

Makefile rule being skipped

I can't seem to get a rule in my Makefile to ever run... even if I change the rule to force make to re-enter the rule, or if I change the dependent files the rule depends on. Any ideas why the second rule is being ignored here? #MAKEFILES = $(DIRS:%=$(ROOT)/%/Makefile) #$(MAKEFILES):... (0 Replies)
Discussion started by: foureightyeast
0 Replies

6. Programming

compile fails in linux ... "No rule to make target" ... HELP

hello all, attached you can find a tool (written in C) that i really need to make it compile under linux i am able to compile and run it successfully in mac os x, but in linux the compilation fails the only thing that i did so far is to change the following #include <sys/malloc.h> to... (13 Replies)
Discussion started by: OneDreamCloser
13 Replies

7. Programming

Issue with make, no rule to make target etc.

I have been trying to split up my src directory to clear out files that are not re-compiled very often. Now I have the following setup in my trunk, trunk/bld trunk/src/ trunk/src/src_server trunk/makefile.linux In the make file, I have compile rules SOURCELOC = src # compile src c++... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

8. Shell Programming and Scripting

MakeFile Backup Target

Goal: I'm trying to create a PHONY target inside my Makefile so that when I run the command "make backup", It will move all the files that end in "~" into the specified backup folder. Here is my code currently, and I'll explain the problem after: .PHONY: backup backup: @mkdir -p... (2 Replies)
Discussion started by: Xploit
2 Replies

9. UNIX for Dummies Questions & Answers

Defining a new suffix rule in a Makefile

Hi everybody, I have a Makefile where a single suffix rule is defined: .SUFFIXES: .cpp .cpp.o: ${CXX} ${CXXFLAGS} -c -o $@ $< And I'd like to create another where an additional flag is added to compile in SMP. Right now, I have to do it like this: interface-smp.o:... (2 Replies)
Discussion started by: Zel2008
2 Replies

10. Shell Programming and Scripting

Default rule to be executed in makefile

Hi all, I want to know the entry point (default rule to be executed) in a makefile once all defined variables are evaluated. I do not have all: in my makefile and I give "make" without any parameter in command line. thanks........ (3 Replies)
Discussion started by: useless79
3 Replies
XMKMF(1)						      General Commands Manual							  XMKMF(1)

NAME
xmkmf - create a Makefile from an Imakefile SYNOPSIS
xmkmf [ -a ] [ topdir [ curdir ] ] DESCRIPTION
The xmkmf command is the normal way to create a Makefile from an Imakefile shipped with third-party software. When invoked with no arguments in a directory containing an Imakefile, the imake program is run with arguments appropriate for your system (configured into xmkmf when X was built) and generates a Makefile. When invoked with the -a option, xmkmf builds the Makefile in the current directory, and then automatically executes ``make Makefiles'' (in case there are subdirectories), ``make includes'', and ``make depend'' for you. This is the normal way to configure software that is out- side the X Consortium build tree. If working inside the X Consortium build tree (unlikely unless you are an X developer, and even then this option is never really used), the topdir argument should be specified as the relative pathname from the current directory to the top of the build tree. Optionally, curdir may be specified as a relative pathname from the top of the build tree to the current directory. It is necessary to supply curdir if the current directory has subdirectories, or the Makefile will not be able to build the subdirectories. If a topdir is given, xmkmf assumes nothing is installed on your system and looks for files in the build tree instead of using the installed versions. SEE ALSO
imake(1) X Version 11 imake 1.0.2 XMKMF(1)
All times are GMT -4. The time now is 08:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy