473,466 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

makefile conditional error, UNIX

62 New Member
Hi everyone,
I'm trying to write a makefile with a conditional statement that uses a variable to specify a C compiler which may be cc or gcc.
I am basically using the example we were given in the notes for this task, but it is giving me error.
This is the code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. libs_for_gcc = -lgnu
  3. normal_libs =
  4.  
  5. objects = myApp.o hello.o here.o bye.o
  6. myApp : $(objects)
  7.  
  8. ifeq ($(CC),gcc)
  9.         $(CC) -o myApp $(objects) $(libs_for_gcc)
  10. else
  11.         $(CC) -o myApp $(objects) $(normal_libs)
  12. endif
  13.  
  14. myApp.o : myApp.c
  15.         cc -c myApp.c
  16. hello.o : hello.c
  17.         cc -c hello.c
  18. here.o : here.c
  19.         cc -c here.c
  20. bye.o : bye.c
  21.         cc -c bye.c
  22.  
  23. clean :
  24.         rm -f $(objects)
  25.  
  26.  
And the output I'm getting after make command is:
make: Fatal error in reader: myMakefile, line 6: Unexpected end of line seen

The line 6 is before the 'else' statement.
Can anyone please tell me what is wrong here?? This is very urgent!
Feb 5 '08 #1
0 1359

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jamie Saker | last post by:
I think I'm overlooking something assumed in socket's makefile method. Googling several hours and digging thru the python reference didn't help - I think I'm overlooking an assumption between...
4
by: Sharp Tool | last post by:
Hi I have downloaded a program that is written in C++ that I would like to compile into a Win XP executable. The program contains a Makefile written for Unix/linux/cygwin. I would like to...
1
by: Carson | last post by:
Hi, I have a problem with Makefile. I have a piece of c code, which is stored in my unix account. I wrote a Makefile for that particular compilation (using gcc), and it works fine. But...
6
by: dolphin | last post by:
Hi! I am learing makefile recently.Now I have a problem. I write a very simple program just like "hello world" I write two makefile for it.One is included in another. the first is makefile...
4
by: Jess | last post by:
Hello, I am now trying to use makefile to compile C++ programs. My makefile looks like: f1.o : f1.cpp h1.h h2.h g++ -c f1.cpp f2.o : f2.cpp h2.h h3.h g++ -c f2.cpp
9
by: raju2000myin | last post by:
i wrote one makefile but it shows multiple definition error how can i resolve that problem it is urgent to me please help to me............. ramesh............
1
by: oldfarts | last post by:
I am trying to put some conditional in my makefile and I have tried every combination in the public gmake manual.. Why does this not work and if it is wrong how DO I do a conditional that would...
5
by: M.Liang Liu | last post by:
I have a project with the following dirs: --------------------------------------------------------------------------------------- +src |-proj0 |-program1 |-program2 |-proj1 |-program1...
2
by: chutsu | last post by:
I'm basically a summer student working on a program called Rivet. (http://projects.hepforge.org/rivet/) And I'm trying to port it to BOINC so that the hosts can download the BOINC client and do...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.