Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Sign up or Login to participate.
|
|||||||
Download Now:
make rules file
|
|
Thread Tools | Search this Thread |
|
#1
|
|||
|
|||
|
make rules file
Hi, anyone explain the following lines in the
/usr/share/lib/make/make.rules(symbols): .c.a: $(COMPILE.c) -o $% $< $(AR) $(ARFLAGS) $@ $% $(RM) $% and .c~.o: $(GET) $(GFLAGS) -P $< > $*.c $(CC) $(CFLAGS) -c $*.c If you could, please, thank you |
|
#2
|
||||
|
||||
|
Someone's schoolwork again?
These are suffix rules and show what make is supposed to do when it is requested to process a source ending with .c and a target ending with .a for example. |
|
#3
|
||||
|
||||
|
Quote:
.c.a: a rule to make a .A thing from a .C thing $(COMPILE.c) -o $% $< an action to assemble it $(AR) $(ARFLAGS) $@ $% an action to archive it $(RM) $% an action to delete the .a thing once archived .c~.o: rule to create a .o from a .c source $(GET) $(GFLAGS) -P $< > $*.c action to fetch the source file $(CC) $(CFLAGS) -c $*.c and action to compile it understand, $(xxx) are macros defined elsewhere and therefore can literally be anything. I've suggested typical action knowing what the rule: imply. Try google for 'GNU Make' for online reference material |
|
#4
|
|||
|
|||
|
Thank you,by the way I have one of the worst teachers and he did not do a
good job explaining. |
|
#5
|
||||
|
||||
|
MAKE is a wonderfull tool.
Normally the 'default' rules (ie those built into the product) just do the right thing, but you can teach it how to do every step. The non-default rule that is really neat is the ability to ensure that your copy of the source is up-to-date with respect to the source management system (sccs, rcs, or cvs). the rules are hierarchial, so each step of the process can be controlled by you. typically, the first rule is all: all: config, build, installthe white-spaces between the rules are critical; they are the delimiters of the actions associated to the rule immediately above. by this example, the following are all valid invocations of this makefile; make allthis ought to stimulate some reading and usage for the tool. |
|
|
|
#6
|
|||
|
|||
|
Thank you now its clear!
|
|
#7
|
||||
|
||||
|
Quote:
|
|
#8
|
|||
|
|||
|
Just to make sure:
Difference between My make.rules and Built in make.rules: Mine: If I have my own make.rule file the make must comply to my rules, and build the objects accordingly. Built in: I dont have to worry about rules that the make is going by, the only thing I need is write my own makefile with my own depencencies and commands. |
|
#9
|
||||
|
||||
|
Quote:
Quote:
'for the sample rules above...' |
![]() |
| Similar Topics | ||||
| Topic | Replies | Forum | ||
So many rules
|
0 | Introduce yourself | ||
Can someone help me make sense of this.dmp file
|
1 | Windows OS | ||
How to make List the default file view in XP Home!?
|
2 | Windows OS | ||
make xvid file fit on cd?
|
6 | Audio and Video | ||
Make a batch file open a program in XP
|
4 | Windows OS | ||
| Thread Tools | Search this Thread |
|
|
All times are GMT -4. The time now is 09:33 PM.



So many rules