After:
Should be:
But there are, instead only spaces.
I don't think your all: rule is working either, but it's that long since I've written a makefile, have forgotten more than I know It doesn't help that your script is obfuscating the actual make error with its own. If you run just the function on its own, you would see the actual make error.
Okay, so after playing around with it I have changed the way the Makefile is created to:
There are TABs after clean: build: and all: and there are TABS before rm, gcc and clean. I have also changed the compileRepository method to:
So it will just attempt to make it - then exit. This leaves the output on the screen which was an error message until I removed the 'all' from the make command. Now it outputs:
Which is the code in the clean function of the Makefile. Have I set up my Makefile incorrectly do you think?
Arghh... really doesn't help that I had a file called makefile in my directory, which make was using instead of Makefile
This does work fine, as far as I can see, so it would help to see the actual make error, not the one your script is displaying.
Saying nothing as to the rest of your code because I haven't read it, it would be slightly cleaner using cat instead of echo to print the Makefile and C file.
e.g.
Your makefile may remove the cfile.c file, so you need to run "populateCFiles" every time before you run make (as clean is the first rule), make all or make clean.
After making the changes you suggested to my program the first error I recieved was:
This was because I copy and pasted directly from the forum.. after correcting it and re-running the program I then recieved:
Originally I thought this meant I was in the wrong directory to call the makefile but clearly not if it can actually interpret the lines from the file. I realised I had been deleting the .c file before compiling it so there was nothing to compile. After changing the clean statement to:
Running the make all command returned:
With no errors! However there is no cfile.out in the directory or any compiled c file! What else am I missing?
---------- Post updated at 01:05 PM ---------- Previous update was at 01:03 PM ----------
UPDATE: It is in the directory I just couldn't see it. Thank you so much for your help! Problem solved!!!
What if you run the gcc command directly (from the directory where the .c file is)?
Show your makefile:
(and just to not make the same mistake I did, make sure there are no other makefiles there!)
I have written this makefile and am getting an error saying
make nfd
gfortran -O -Wall -fbacktrace -fno-align-commons -c -o fd.o fd.f
fd.f:49: Error: Can't open included file 'fd.par'
make: *** Error 1
The directory structure is as follows
.
├── library
│ ├── fd
│ │ ├──... (3 Replies)
Hello,
I have a Makefile that converts wrl (vrml) files to html files...
how can I use a shell script in that makefile which works on all html files after converting?
The Shell Script have to find and replace a String in every createt html file.
sorry I'm a Newbie, so I hope someone can... (0 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error:
make: module: command not found
Why is this? Is there any way to run this command in a Makefile?
NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Hi,
Can we execute a shell script by makefile.
I mean we will write a shell script in a make file and it will be executed when we compile the C++ program using make file. (2 Replies)
Hi
I am new to shell scripting and makefile. I want a command's output in
makefile to process further, can anyone plz suggest me a way ?
I want ls -d *.dsm output in a variable and want to process it in makefile itself.
It's urgent
Thanks In advance (0 Replies)
Hello World ! ! !
I need libraries to use grib files. I only know the C language at the moment and I am working at the University under Red Hat 9.0. I downloaded the g2clib library (the best that I found) but I did not success to run the makefile. Here is the original file. I modified some... (4 Replies)