MKDEP(1) BSD General Commands Manual MKDEP(1)NAME
mkdep -- construct Makefile dependency list
SYNOPSIS
mkdep [-ap] [-f file] [flags] file ...
DESCRIPTION
mkdep takes a set of flags for the C compiler and a list of C source files as arguments and constructs a set of include file dependencies
which are written into the file ``.depend''. An example of its use in a Makefile might be:
CFLAGS= -O -I../include
SRCS= file1.c file2.c
depend:
mkdep ${CFLAGS} ${SRCS}
where the macro SRCS is the list of C source files and the macro CFLAGS is the list of flags for the C compiler.
The options are as follows:
-a Append to the output file, so that multiple mkdep's may be run from a single Makefile.
-f Write the include file dependencies to file, instead of the default ``.depend''.
-p Cause mkdep to produce dependencies of the form:
program: program.c
so that subsequent makes will produce program directly from its C module rather than using an intermediate .o module. This is useful
for programs whose source is contained in a single module.
SEE ALSO cc(1), cpp(1), make(1)FILES
.depend File containing list of dependencies.
HISTORY
The mkdep command appeared in 4.3BSD-Tahoe.
4.2 Berkeley Distribution June 6, 1993 4.2 Berkeley Distribution
Check Out this Related Man Page
mkdep(1) General Commands Manual mkdep(1)NAME
mkdep - generate dependency list from a C program
SYNOPSIS
mkdep [-a] [-f depend_file] [-p] [cc_options] file...
The mkdep command generates a dependency list file from a C source program.
OPTIONS
Causes mkdep to append its output to the end of the dependency file instead of creating a new dependency file. If the dependency file does
not exist, mkdep creates it. Specifies a name for the dependency file; overrides the default file name Inhibits mkdep from appending the
suffix to the names of object files listed in the output.
DESCRIPTION
The mkdep command uses cc(1) to compile a list of dependency files required to build the named C program file or files. The list is for-
matted so that it is suitable for inclusion into a makefile for make(1). Duplicate dependency listings for a given program are included
only once in the output.
You can specify C compiler options by including them in the command line; mkdep passes all unrecognized options through to the compiler.
By default, mkdep writes to a file named -f option to specify an alternative output file name.
EXAMPLES
The following example illustrates the use of mkdep with the -p option:
% cat hello.c #include <stdio.h>
main() {
printf("%s0","Hello World!"); } % mkdep -p -f hello.depend hello.c % cat hello.depend hello: hello.c /usr/include/stdio.h
/usr/include/standards.h hello: /usr/include/sys/types.h /usr/include/standards.h hello: /usr/include/mach/machine/vm_types.h
/usr/include/sys/limits.h hello: /usr/include/standards.h /usr/include/machine/machlimits.h hello: /usr/include/sys/syslimits.h
/usr/include/float.h hello: /usr/include/standards.h /usr/include/fp_class.h hello: /usr/include/machine/machtime.h
SEE ALSO
Commands: cc(1), make(1)mkdep(1)
EXE=auto
SRCS=auto.cpp debug.cpp
OBJS=auto.o debug.o
CXX=g++
#HOSTFLAG=-DLinux
HOSTFLAG=-DSunOS
# Do not use compiler optimizer -O as this may break the program
# Use debug flag to enable the debug() function. If DEBUG is not
# defined than the function debug() is set to void(),... (1 Reply)
I m using SUN Studiuo11 compiler.There is problem while building Makefile.
I got error as dmake:fetal error command failed for target
plz help me. (7 Replies)
Hi,
we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier).
As a part of this i need to change the CFLAGS.
The xl c/c++ complier CFLAGS is
CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \
-qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Hi,
What I want to do is for make to reconstruct the target even if its dependencies have not changed. So, even if if the dependent files do not have a more recent timestamp, the commands are executed.
The reason I want to do this..
1)someone executes make on solaris. We have a solaris... (4 Replies)
Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error:
make: module: command not found
Why is this? Is there any way to run this command in a Makefile?
NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (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)
I have the following part of a makefile and want to simplify it
using rules rather than having to code the same two blocks
when I need ti build another program.
An having difficulty doing it
all: 1dvel2 1dvel 2dvel
... (8 Replies)