MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everybody...
This is the directory structure of my Main folder, for which i need to write a top level makefile
$> ls /home/rah/MAIN
AF/
Middleware/
Platform/
Tools/-->toolchain_2.8.0/-->(bin/,include/,man/,lib/,usr/,share/,doc/,uclibc/)
Utils/
So the problem is that i need to write a top level makefile(which will reside in MAIN) and also i need to generate a ncurses based menu for compiling it.
All the Af,MW,platform,tools and utils directories have their makefiles ready.Now i need to write a top level makefile to link them all and also a ncurses based menu.
pls help me on this,its really urgent.
Thank you all
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
For ncurses, you're on your own but here's what a top-level Makefile would look like:
Code:
MAKEFILE = Makefile
# Note: defined here, these will override local Makefile;
# dont' define these unelss they're common to all subdirectories
CFLAGS = -O (or whatever you need)
# Note: defined here, these will override local Makefile;
# dont' define these unelss they're common to all subdirectories
LDFLAGS = -lm (or whatever you need)
ALL: build
build:
@echo "Building system..."
cd AF; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
cd Middleware; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
cd Platform; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
cd Tools; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
install:
@echo "Installing system..."
cd AF; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
cd Middleware; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
cd Platform; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
cd Tools; make CFLAGS="$(CFLAGS)" LDFFLAGS="$(LDFFLAGS)"
clean:
@echo "Clean system..."
cd AF; make clean
cd Middleware; make clean
cd Platform; make clean
cd Tools; make clean
Now, if you do CFLAGS and LDFLAGS like this, they will override whatever is defined in a "local" Makefile; if you have different flags in you local Makefiles, don't define them in this Makefile and your "build" section would then look like
Code:
build:
@echo "Building system..."
cd AF; make
cd Middleware; make
cd Platform; make
cd Tools; make
Hope this helps some, sorry that I can't write a ncurses for you but, you know, the command line works just fine, too.
So the problem now is that i need to write a top level makefile that resides in Main/Mware/ and removes the .d (dependency) files and instead cretaes .so and .o files, while also taking care of the lower level makefiles.
Please ,help, im stuck again.
thanx
Last edited by rushadrenaline; 12-10-2007 at 11:31 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.