[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Makefile
From: |
xueyue |
Subject: |
Re: Makefile |
Date: |
Wed, 30 Jun 1999 11:29:25 +0000 |
Dear Marcus,
I was not able to solve the problem with your following suggestion. This
was due to that I still can not totally understand how to modify
respective Makefiles. However, I did
solve the problem with my own awkward but successful way.
First, in each subdirectory where some classes are defined, there is a
Makefile, for example, the Makefile in modelSwarm/node directroy looks
like:
====================
ifeq ($(SWARMHOME),)
SWARMHOME=/usr
endif
APPLICATION=test
OBJECTS=main.o MATSNodeItem.o MATSLinkItem.o
include $(SWARMHOME)/etc/swarm/Makefile.appl
main.o: main.m
MATSNodeItem.o: MATSNodeItem.h MATSNodeItem.m
MATSLinkItem.o: MATSLinkItem.h MATSNodeItem.h MATSLinkItem.m
=======================
here main.m is just the main programme doing nothing. (without
it, make will not work).
then in a (super) directory, there is a Makefile:
=============================================================
ifeq ($(SWARMHOME),)
SWARMHOME=/usr
endif
SUBDIRS = modelSwarm/node modelSwarm/traveller modelSwarm
APPLICATION=mats
OBJECTS=main.o
headers:
for i in $(SUBDIRS) ; do $(MAKE) -C $$i; done
=============================================================
then, when make is executed in this superdirectory, all
Makefiles' command in directories in SUBDIRS will be executed, i.e.,
make will be successfully executed in each of the directories in
SUBDIRS.
I have been able to go round the problem, and the solution
is good enough for my project. But I think this problem should
not have happened if files in /usr/etc/swarm/, Makefile.lib,
Makefile.rules, and Makefile.common, etc., are correct. Why
I am saying so? Let us look again at Makefile I sent before:
=============Makefile=======================
ifeq ($(SWARMHOME),)
SWARMHOME=/usr
endif
APPLICATION=mats
OBJECTS=main.o traveller/Traveller.o clock/CurrentTime.o ModelSwarm.o
node/MATSNodeItem.o node/MATSLinkItem.o router/RouteFinder.o
include $(SWARMHOME)/etc/swarm/Makefile.appl
main.o: main.m ModelSwarm.h
router/RouteFinder.o: router/RouteFinder.h router/RouteFinder.m
==============End====================================
To our general understanding, make will produce two object
files: main.o and router/RouterFinder.o. However,
When make is executed, we can see the process of compiling, and the
following command will be executed:
egcs -c -Wno-import -Wno-protocol -g -O2 -fno-inline -D_GNU_SOURCE
-I/usr/include/swarm router/RouterFinder.m
The only problem is that after RouterFinder.m is compiled,
the result can not be written in router/RouterFinder.o!!!
That is why I think some files in /usr/etc/swarm/ may have
some minor faults. If so, I think they may need to be modified.
Cheers!
> >>>>> "XH" == xueyue <address@hidden> writes:
>
> XH> Are there somethings missing in my Makefile?
>
> I suggest you add a Makefile in your route directory that includes
> Makefile.lib, i.e. build a libroute.a (you can use graph-1.4.1.tar.gz for an
> example). Then, in the toplevel Makefile add a rule like:
>
> route/libroute.a
> $(MAKE) -C route
>
vcard.vcf
Description: Card for Xueyue Huang