LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-13-2005, 05:46 AM   #1
gogettergary
LQ Newbie
 
Registered: May 2005
Posts: 4

Rep: Reputation: 0
query regarding makefiles...


hi

im working on a project with a main program , several dependent programs and some created header files. im compiling it using make utility
i hav sum queries regarding makefiles:


1. the header files in my project include each other..will this create any problem?

2. do i need to specify the system header files (iostream math.h infotype etc.) separately like i specify created header files?
as in : pooja.o : headerf1.h hf2.h


3. wats the difference in using gcc n g++ .my prgs are .cpp but im using gcc -o p p.cpp
will it giv problems??


4. in wat order shud i write the main prg n dependent prgs in the makefile?


5. on running makefile WITH "MAKE -F MAKEFILE" i get the error

error: missing separator . stop.

even though im giving tab before build command

6. HERE IM INCLUDING THE MAKEFILE ..PLZ TAKE A LOOK


*****************MAKEFILE**********************************************************


VPATH = \
/PNR/GOSPL/src/inputnetlistgenerator \
/PNR/GOSPL/src/opex \
/PNR/GOSPL/src/stub \
/PNR/GOSPL/src/routingsolution \
/PNR/GOSPL/src/routingoptions \
/PNR/GOSPL/src/devicemodeling
/PNR/GOSPL/src/routingstatisticgenerator \
/PNR/GOSPL/Include/Stub \
/PNR/GOSPL/Include/Opex \
/PNR/GOSPL/Include/RoutingSolution \
/PNR/GOSPL/Include/RoutingOptions \
/PNR/GOSPL/Include/DeviceModeling \
/PNR/GOSPL/Include/InputNetlistGenerator \
/PNR/GOSPL/Include/RoutingStatisticGenerator \
/IDB/ICHOROUS/include/VMM/Alloc \
/IDB/ICHOROUS/include/VMM/OSInteractor \
/IDB/ICHOROUS/include/VMM/Stl \
/IDB/ICHOROUS/include/VMM/StorageManager \
/IDB/ICHOROUS/include/VMM/userInterface \
/IDB/ICHOROUS/src/vmm/alloc \
/IDB/ICHOROUS/src/vmm/osinteractor \
/IDB/ICHOROUS/src/vmm/storagemanager \

var1= rfc_croutingflowcontroller.o dm_cdetaileddevicemodeler.o dm_cdevicedatabase.o \ dm_cdevicemodelgenerator.o dm_clocalarchdatabase.o dm_crrnodeindices.o \ dm_staticmemberdefinitions.o ing_cinputdesign.o \
ring_cinputnetlistgenerator.o ring_cpinnetlistlexer.o \ ring_cpinnetlistparser.o cdesignroutingsolution.o cnetroutingsolution.o \ cplacerverilogoutputtranslator.o croutingsolutionnode.o \ croutingsolutiontranslator.o ctruthtable.o placerverilogoutputlexer.o \ placerverilogoutputparser.o routingoptions.o \
rsg_croutingstatisticsgenerator.o dm_coralstub.o \
opex_ccontaineredgwts.o opex_ccontainererrwts.o opex_ccreator.o \ opex_cdefaultcondition.o opex_cdefaultnet.o opex_cedgetypeweight.o \ opex_cerrtypeweight.o opex_cinputconstraints.o opex_clegalitychecker.o \ opex_cnet.o opex_cnetlist.o opex_croudrivenlegchecker.o \
opex_croutability.o opex_croutabilityrerouteconditions.o \ opex_croutexpansion.o opex_croutinginfo.o opex_croutingsolution.o \ opex_croutingtree.o opex_crrnode.o opex_crrnodeslist.o opex_cswitcbox.o \ opex_cswitchboxlist.o opex_ctimdrivenlegchecker.o opex_ctiming.o \ opex_ctimingexpansion.o opex_ctimingrerouteconditions.o \
opex_cboundingbox.o opex_cdesignrouter.o opex_copex.o \ opex_creroutecondition.o cbintransferheap.o \ cfile.o cmappedfile.o cclassdescriptor.o cclassdictionary.o \
cstorageheader.o cstoragesupervisor.o \

makefile : $(var1) \
gcc -o makefile $(var1) \

rfc_croutingflowcontroller.o : RFC_CRoutingFlowController.h \ RING_CInputNetlistGenerator.h RING_CInputDesign.h DM_CDetailedDeviceModeler.h DM_CDeviceDatabase.h DM_CoralStub.h CDesignRoutingSolution.h \ RoutingOptions.h Opex_COpex.h RSG_CRoutingStatisticsGenerator.h \ CRoutingSolutionTranslator.h CPlacerVerilogOutputTranslator.h \

dm_cdetaileddevicemodeler.o dm_staticmemberdefinitions.o : \ CSTLMacroDefinition.h \

dm_cdevicedatabase.o dm_cdevicemodelgenerator.o \
dm_staticmemberdefinitions.o ring_cinputnetlistgenerator.o \ cdesignroutingsolution.o cdesignroutingsolution.o opex_ccontaineredgwts.o \ opex_cnetlist.o opex_cboundingbox.o: DM_CDeviceDatabase.h \

dm_cdevicemodelgenerator.o dm_clocalarchdatabase.o \ dm_staticmemberdefinitions.o ring_cinputnetlistgenerator.o : \ DM_CLocalArchDatabase.h \

dm_cdetaileddevicemodeler.o : CStorageSupervisor.h CMappedFile.h \

dm_cdevicemodelgenerator.o : DM_CDeviceModelGenerator.h \

dm_crrnodeindices.o : DM_CRRNodeIndices.h \

dm_staticmemberdefinitions.o : DM_CChipInfo.h \

ring_cinputdesign.o ring_cpinnetlistparser.o croutingsolutiontranslator.o \ croutingsolutiontranslator.o: RING_CInputDesign.h \

ring_cinputnetlistgenerator.o ring_cpinnetlistparser.o: \ RING_CInputNetlistGenerator.h RING_ETypeDefinitions.h DM_TypeDefinitions.h \

ring_cpinnetlistlexer.o : RING_CPinNetlistParser.h \

cdesignroutingsolution.o croutingsolutiontranslator.o: \ CDesignRoutingSolution.h RING_CInputPhysicalNetlist.h \

cdesignroutingsolution.o routingoptions.o \
rsg_croutingstatisticsgenerator.o opex_cinputconstraints.o: RoutingOptions.h

cnetroutingsolution.o : CNetRoutingSolution.h

cplacerverilogoutputtranslator.o ctruthtable.o \
placerverilogoutputparser.o: CTruthTable.h

cplacerverilogoutputtranslator.o : CPlacerVerilogOutputTranslator.h \

croutingsolutionnode.o : CRoutingSolutionNode.h \

croutingsolutiontranslator.o placerverilogoutputparser.o : \ CRoutingSolutionTranslator.h \

placerverilogoutputlexer.o : PlacerVerilogOutputParser.h \

rsg_croutingstatisticsgenerator.o : RSG_CRoutingStatisticsGenerator.h \ CDesignRoutingSolution.h \

dm_coralstub.o : DM_CoralStub.h DM_TypeDefinitions.h \

cbintransferheap.o : CBinTransferHeap.h \

cfile.o : CFile.h \

cmappedfile.o : CMappedFile.h \

cclassdescriptor.o : CClassDescriptor.h \

cclassdictionary.o : CClassDictionary.h \

cstorageheader.o : CStorageHeader.h \

cstoragesupervisor.o : CStorageSupervisor.h \
opex_copex.o : Opex_COpex.h Opex_CswitchBoxList.h Opex_Ccreator.h
opex_cdesignrouter.o opex_copex.o :Opex_CroutingInfo.h Opex_CdesignRouter.h \ Opex_CdetailedExpansion.h Opex_CnetList.h \
opex_ccontaineredgwts.o opex_cdefaultconditions.o opex_cinputconstraints.o \ opex_cnet.o opex_cnetlist.o opex_croutabilityrerouteconditions.o \ opex_croutinginfo.o opex_crrnode.o opex_crrnodeslist.o opex_cswitchboxlist.o \ opex_ctimdrivenlegchecker.o opex_ctimingrerouteconditions.o: \ Opex_CinputConstraints.h \
opex_ccontaineredgwts.o opex_cdetailedexpansion.o: Opex_CcontainerEdgWts.h \
opex_ccontainererrwts.o opex_cdetailedexpansion.o \ opex_croutabilityrerouteconditions.o opex_ctimingrerouteconditions.o : \ Opex_CcontainerErrWts.h \
opex_ccreator.o : Opex_Ccreator.h Opex_Cnet.h Opex_CdetailedExpansion.h \ Opex_CtimingExpansion.h Opex_CroutExpansion.h Opex_Croutability.h \ Opex_Ctiming.h Opex_CdefaultNet.h typeinfo.h \
opex_cdefaultconditions.o : Opex_CdefaultConditions.h Opex_CnetList.h \ opex_cdefaultconditions.o opex_cnet.o opex_cnetlist.o opex_crrnodeslist.o \ opex_cboundingbox.o :Opex_CRrnodesList.h \
opex_cdefaultnet.o : Opex_CdefaultNet.h \
opex_cdetailedexpansion.o : Opex_CdetailedExpansion.h Opex_Cpredicate.h \
opex_cedgetypeweight.o : Opex_CedgeTypeWeight.h \
opex_cerrtypeweight.o: Opex_CerrTypeWeight.h \
opex_clegalitychecker.o opex_cdesignrouter.o : Opex_ClegalityChecker.h \
opex_cnet.o: Opex_Cnet.h Opex_CTypedef.h \
opex_cnetlist.o : Opex_CnetList.h Opex_Ccreator.h \
\ Opex_CRrnodesList.h Opex_CcontainerErrWts.h \

opex_crerouteconditions.o opex_cdesignrouter.o : Opex_CreRouteConditions.h \
opex_croudrivenlegchecker.o : Opex_CrouDrivenLegChecker.h Opex_CnetList.h \
opex_croutability.o: Opex_Croutability.h Opex_CrouDrivenLegChecker.h \ opex_croutabilityrerouteconditions.o opex_croutability.o: \ Opex_CroutabilityReRouteConditions.h \
opex_croutabilityrerouteconditions.o opex_ctimdrivenlegchecker.o \ opex_ctimingrerouteconditions.o opex_croutingsolution.o : Opex_CnetList.h \
opex_croutingsolution.o opex_croutinginfo.o \ opex_croutabilityrerouteconditions.o opex_ctimingrerouteconditions.o \ opex_cdesignrouter.o : Opex_CRoutingSolution.h \
opex_croutexpansion.o :Opex_CroutExpansion.h Opex_CTypedef.h \
opex_croutinginfo.o : Opex_CroutingInfo.h \

opex_croutingtree.o opex_crrnodeslist.o: Opex_CroutingTree.h \
opex_crrnode.o opex_cboundingbox.o : Opex_CRrnode.h \
opex_cswitchbox.o : Opex_CswitchBox.h \
opex_cswitchboxlist.o : Opex_CswitchBoxList.h \
opex_ctimdrivenlegchecker.o opex_ctiming.o: Opex_CtimDrivenLegChecker.h \
opex_ctiming.o : Opex_Ctiming.h \
opex_ctiming.o opex_ctimingrerouteconditions.o : \ Opex_CtimingReRouteConditions.h \
opex_ctimingexpansion.o : Opex_CtimingExpansion.h \


opex_cboundingbox.o : Opex_CboundingBox.h \

opex_cdesignrouter.o : RoutingOptions.h Opex_Ccreator.h







*******************************END****************************************

looking for sumbdy who can give sound advice......

pooja
 
Old 05-13-2005, 06:59 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Re: query regarding makefiles...

Quote:
Originally posted by gogettergary
1. the header files in my project include each other..will this create any problem?
This will be a problem, unless you follow the often used way to prevent problems with this. To do this for an example header file called "foo.h":
Code:
/* At the start of "foo.h" do this: */
#ifndef FOO_H   /* uniquely identifies this header file */
#define FOO_H

/* Put actual contents of your header here */

/* And at the end: */
#endif  /* FOO_H */
It's generally a good idea to do this for each header you create. But use a different, unique macro for each one. E.g. for a header "bar.h" you would do the same thing, but use "BAR_H" instead of "FOO_H".

Quote:
2. do i need to specify the system header files (iostream math.h infotype etc.) separately like i specify created header files?
as in : pooja.o : headerf1.h hf2.h
No.
Quote:
3. wats the difference in using gcc n g++ .my prgs are .cpp but im using gcc -o p p.cpp
will it giv problems??
gcc is the C compiler.
g++ is the C++ compiler.

Sometimes (often?) you can compile C-code with a C++-compiler (g++). But not the other way around: you cannot compile C++-code with a C-compiler (gcc).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefiles deveshs Linux - Software 2 05-02-2005 05:26 AM
Those makefiles... boku Programming 10 03-01-2005 08:19 AM
Makefiles and Me dpottinger Linux - Newbie 5 07-24-2004 11:14 PM
MAKEFILEs shinpadsmt Linux - Newbie 3 02-21-2004 02:52 AM
Why makefiles parthi4u Programming 4 03-08-2003 03:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration