Make Utility Question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Make Utility Question
Prev   Next
# 2  
Old 11-10-2012
In this makefile, test has dependencies on dep1.o and dep2.o, dep1.o has a dependency on dep1.c, and dep2.o has a dependency on dep2.c. If your commands to update dep1.o and dep2.o don't create dep1.c and dep2.c, respectively, before updating dep1.o and dep2.o then dep1.o and dep2.o will never be considered up-to-date and will have to be rebuilt every time you check to see if test is up-to-date.

Normally, for something like this you would start out with dep1.c and dep2.c and make would use something like cc -c dep1.c to create dep1.o, cc -c dep2.c to create dep2.o, and the commands to update test would then link dep1.o, dep2.o, and whatever startup code is needed to produce test. Then subsequent invocations of make wouldn't need to do anything until you updated one of your C source files.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

A make-like build utility based on Lua

xmake is a make-like build utility based on lua. (Link to project site: xmake) The project focuses on making development and building easier and provides many features (.e.g package, install, plugin, macro, action, option, task ...), so that any developer can quickly pick it up and enjoy the... (1 Reply)
Discussion started by: waruqi
1 Replies

2. Programming

make utility

Hi, Could someone tell me why make utility is mostly preferred for compilation and generating executable in UNIX rather than any user created scripts which contains commands for compilation? (2 Replies)
Discussion started by: naan
2 Replies

3. Programming

Help with a C program that acts like the make utility

Hi, I'm trying to create a C program that functions like the make utility in UNIX for personal use. My program would read in from a generic makefile and execute whatever is in that makefile but I'm not sure as to where I should start coding. I would appreciate any help. Thanks. (1 Reply)
Discussion started by: kratos.
1 Replies

4. UNIX for Dummies Questions & Answers

How to print something in make utility

Hi want to know the syntax of printing something (value or variable) in GNU make utility. I give this in the Makefile: echo "Hi" OR @echo "Hi" But I only get error this when I run make (at the line where I have echo): Makefile:9: *** missing separator. Stop. Whats the problem? How can... (2 Replies)
Discussion started by: radiatejava
2 Replies

5. Solaris

Make utility - some Qs togurus..

(Sorry for previous not on enlish! I did not realized it is english forum. ) I am looking for help with Make utility. I could not get help from the 'man' pages. 1. About Macro (as a variable): It is clear about defining any macro in beginning or in command line, but isn't it no way to redefine... (0 Replies)
Discussion started by: alex_5161
0 Replies

6. UNIX for Dummies Questions & Answers

is there kind of good utility that convert make files to dsp?

Hello all im looking for some kind of utility that convert make files to dsp files is there any kind of tool/script that does this job? thanks (1 Reply)
Discussion started by: umen
1 Replies

7. Solaris

Make utility

Hi Guys, I m very confused about the make/makefile utility in all unix. 1) My questions is why we need make. 2) Why some source code needs to complile. 3) I download the Bind 9 from Sunfreeware.com. I use pkgadd -d to install the bind. I 'm struck here becasue I can't find /etc/named.conf... (2 Replies)
Discussion started by: bigmoon
2 Replies

8. Programming

MAKE utility

I wrote a makefile, every thing is working fine, But One of the C header files which is created by me is kept in a different folder other than the current directory, I have given this PATH to VPATH Variable Example :- VPATH = /home/user1/projects/victor.h It gives an error as : file... (4 Replies)
Discussion started by: victorvvk
4 Replies

9. Programming

Make utility

When we run the make utility , make compiles only those files which are undergone changes(other files which have not undergone any changes are not recompiled) The Following quotes says When you run the make utility, it examines the modification times of files and determines what needs to be... (4 Replies)
Discussion started by: victorvvk
4 Replies

10. Programming

Using make utility to create an mini-app

The following is my makefile. When I run "make", it gives me a bunch of error. I've compiled each file separately and there are no compilation errors. The target is "monprc". Have a look below: monprc: monprc.o monrep.o dsz.o cc -o monprc monprc.o monrep.o dsz.o monprc.o: monprc.c... (1 Reply)
Discussion started by: Yifan_Guo
1 Replies
Login or Register to Ask a Question
SHAPE_BUILD(1)						      General Commands Manual						    SHAPE_BUILD(1)

NAME
shape_build - shapeTools RMS system building and installation SYNOPSIS
shape [all][VERSIONS=<rule>] [variants] [macro settings] shape install[VERSIONS=<rule>] [INSTALLBASE=<path>] [variants] [macro settings] shape clean[<macro settings>] shape cleancache [<macro settings>] make [all][<macro settings>] make install[INSTALLBASE=<path>] [<macro settings>] make clean[<macro settings>] DESCRIPTION
Shape all, or just shape (as all is the default target), builds the current system node. It performs all necessary actions to derive the main target ($(TARGET) in the Makefile) from the node's source components. Shape all also builds all subsystems of the current node. Before triggering any build action itself, if recursively calls shape for each subsystem. Version selection is driven by the rule given as value to the VERSIONS macro, default is most_recent. The given version selection rule on the command line, if any, is inherited to the recursive calls. Shape install installs the build results of the current node in the appropriate locations. Things to be installed are usually binaries and manuals. The target installtargets in the Makefile lists all these things as its dependents. Shape install updates all build results in the same way as shape all does, before installing them. Shape install invokes all subsystems of the current node in the installation procedure by recursively calling shape install for each of them. This is done, before it performs any build or install actions itself. The appropri- ate versions are selected according to the given version selection rule named in the VERSIONS macro. The default rule for shape install is recent_release selecting the most recent release or prerelease (whichever is newer). The macro INSTALLBASE defines the installation base directory, an absolute pathname pointing to the root of a directory tree, where the build results are to be copied to. Check the Makefile for the default setting of INSTALLBASE and the installation directories defined as relative pathnames starting from the installation base directory. Values of the VERSION and the INSTALLBASE macro set on the command line are inherited to all recursive calls. Shape clean removes all derived objects currently established as UNIX files. These are the files listed in the OBJECTS macro in the Make- file, the derived target ($(TARGET)), and the target aliases ($(ALIASES)). The derived objects, established as UNIX files are those being produced from their source or reinstalled from the derived object cache during the last system build. Shape cleancache cleans up the derived object cache, will say, it removes all objects stored there. All names listed as dependents of the .BPOOL special macro in the Shapefile are candidates to be cached. When multiple (different) versions of derived objects with the same name arise, the older ones are stored to the derived object cache. Shape cleancache in conjunction with shape clean removes all derived (automatically reproducible) objects. The two cleanup actions are not called recursively. They apply only to the current node. The build and cleanup actions (all, install and clean) of the shape RMS can be performed by make(1) and by shape(1). The main difference is, that shape is capable of setting up the appropriate source context according to a given version selection rule, while make only regards the regular UNIX files. Make will fail if not every component of the system has a checked out busy version. The intention for maintaining Makefiles suitable for complete system builds aims at system building and installation from a source distribution rather than from the development area. Source distributions are system copies taken from one of the release trees (partial release area or release area). See shape_RMS(1) for details. Make all, make install and make clean behave similar to their shape counterparts. The difference is, that they expect a complete system source context to be set up as UNIX files (see above). Each macro definition in the Make- or Shapefile may be redefined from the command line. Most of the shape RMS standard macro definitions are inherited to recursive calls of make or shape. Check the shape_tmpl(7) manual page for a list of the standard macros. INCONVENIENCES
For technical reasons, each make call recursively invokes make on the same level before performing any actions. This unfortunately restricts the efficacy of command line options. E.g. there is no chance to work with the -f (alternate name for the Makefile) option and the redefinition of macros is restricted to inherited ones. This restriction does not apply to shape calls. FILES
Makefile Shapefile SEE ALSO
shape_stdrul(7), shape_tmpl(7) 13.10.119 SHAPE_BUILD(1)