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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT V7
make
MAKE(1) General Commands Manual MAKE(1)NAME
make - maintain program groups
SYNOPSIS
make [ -f makefile ] [ option ] ... file ...
DESCRIPTION
Make executes commands in makefile to update one or more target names. Name is typically a program. If no -f option is present, `make-
file' and `Makefile' are tried in order. If makefile is `-', the standard input is taken. More than one -f option may appear
Make updates a target if it depends on prerequisite files that have been modified since the target was last modified, or if the target does
not exist.
Makefile contains a sequence of entries that specify dependencies. The first line of an entry is a blank-separated list of targets, then a
colon, then a list of prerequisite files. Text following a semicolon, and all following lines that begin with a tab, are shell commands to
be executed to update the target.
Sharp and newline surround comments.
The following makefile says that `pgm' depends on two files `a.o' and `b.o', and that they in turn depend on `.c' files and a common file
`incl'.
pgm: a.o b.o
cc a.o b.o -lm -o pgm
a.o: incl a.c
cc -c a.c
b.o: incl b.c
cc -c b.c
Makefile entries of the form
string1 = string2
are macro definitions. Subsequent appearances of $(string1) are replaced by string2. If string1 is a single character, the parentheses
are optional.
Make infers prerequisites for files for which makefile gives no construction commands. For example, a `.c' file may be inferred as prereq-
uisite for a `.o' file and be compiled to produce the `.o' file. Thus the preceding example can be done more briefly:
pgm: a.o b.o
cc a.o b.o -lm -o pgm
a.o b.o: incl
Prerequisites are inferred according to selected suffixes listed as the `prerequisites' for the special name `.SUFFIXES'; multiple lists
accumulate; an empty list clears what came before. Order is significant; the first possible name for which both a file and a rule as
described in the next paragraph exist is inferred. The default list is
.SUFFIXES: .out .o .c .e .r .f .y .l .s
The rule to create a file with suffix s2 that depends on a similarly named file with suffix s1 is specified as an entry for the `target'
s1s2. In such an entry, the special macro $* stands for the target name with suffix deleted, $@ for the full target name, $< for the com-
plete list of prerequisites, and $? for the list of prerequisites that are out of date. For example, a rule for making optimized `.o'
files from `.c' files is
.c.o: ; cc -c -O -o $@ $*.c
Certain macros are used by the default inference rules to communicate optional arguments to any resulting compilations. In particular,
`CFLAGS' is used for cc and f77(1) options, `LFLAGS' and `YFLAGS' for lex and yacc(1) options.
Command lines are executed one at a time, each by its own shell. A line is printed when it is executed unless the special target `.SILENT'
is in makefile, or the first character of the command is `@'.
Commands returning nonzero status (see intro(1)) cause make to terminate unless the special target `.IGNORE' is in makefile or the command
begins with <tab><hyphen>.
Interrupt and quit cause the target to be deleted unless the target depends on the special name `.PRECIOUS'.
Other options:
-i Equivalent to the special entry `.IGNORE:'.
-k When a command returns nonzero status, abandon work on the current entry, but continue on branches that do not depend on the current
entry.
-n Trace and print, but do not execute the commands needed to update the targets.
-t Touch, i.e. update the modified date of targets, without executing any commands.
-r Equivalent to an initial special entry `.SUFFIXES:' with no list.
-s Equivalent to the special entry `.SILENT:'.
FILES
makefile, Makefile
SEE ALSO sh(1), touch(1)
S. I. Feldman Make - A Program for Maintaining Computer Programs
BUGS
Some commands return nonzero status inappropriately. Use -i to overcome the difficulty.
Commands that are directly executed by the shell, notably cd(1), are ineffectual across newlines in make.
MAKE(1)