![]() |
| | #1 |
| Guest
Posts: n/a
| creating make files all: gcc -o file1 file1.c gcc -o file2 file2.c and if i issue the make command i get make: Fatal error in reader: Makefile, line 3: Unexpected end of line seen help!!! thanks. |
|
| | #2 |
| Registered User Join Date: Aug 2001
Posts: 79
| Are you trying to compile two programs, or simply compile a single program that has two .c source files? Either way, you're not supposed to generate the Makefile yourself. You generate the Makefile.am and the configure.in(I think. There might be programs to help. I'm rather new to programming in Linux). type: $info automake In the former case, examples->ctags&etags is a good example. In the latter case, either use a different example or just read the rest of the docs(which are better than your average info help).
__________________ All generalizations are false |
| Flarelocke is offline | |
| | #3 |
| Registered User Join Date: Sep 2001
Posts: 10
| Actually, You can and should create your own make file. Just to be sure you know what you want. I'm using Redhat Linux 6.2 on an i686 not sure if that would affect your makefile any, but the type of OS you are running would no doubt have an effect on the syntax of the things you use. Here's a look at my makefile. Code: CC = gcc PROF = OPTOMIZ = -O2 DEBUG = -g3 WARN = -Wall #C_FLAGS = $(PROF) $(OPTOMIZ) $(WARN) $(DEBUG) C_FLAGS = -c -O -Wall -g3 L_FLAGS = -static -g CRYPT = -lcrypt SYSTEM = O_FILES = act_comm.o act_info.o act_move.o blah blah blah (i'm not sure you need the names of my '.o' files... but here is wher you put your files to be compiled) be sure to leave a '~' at the end or bad things will happen ;) HTH
__________________ Xaviar Khan Programmer/Owner Shards of Destiny (SoD) --------------------------------------- Reach us with any MUD client at ShardsofDestiny.org port 9000. +------------------------------------+ | Html/Java support added, | | 'www.ShardsofDestiny.org' | +------------------------------------+ |
| Xaviar Khan is offline | |
| | #4 |
| Registered User Join Date: Aug 2001
Posts: 149
| Your best bet is to be very specific and break it down into the separate parts. Code: #######################################
#
# Makefile
#
FILES = file1.c file2.c
OBJECTS = file1.o file2.o
all: $(OBJECTS)
gcc -o NameOfExecutable $(OBJECTS)
file1.o: $(FILES) $(OBJECTS)
gcc -c file1.c
file2.o: $(FILES) $(OBJECTS)
gcc -c file2.c
David
__________________ One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them In the Land of Mordor where the Shadows lie. Last edited by Strider; 09-06-2001 at 02:54 PM. |
| Strider is offline | |
| | #5 |
| Guest
Posts: n/a
| a simple hint with the last example parameter_name : dependent files (a.out and the files you'll use ) <tab very imp ok> commands enjoy |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how gnu make tells if file's been changed? | thinhare | C Programming | 2 | 03-19-2008 03:10 AM |
| Make Files | shipyard | C Programming | 6 | 03-13-2005 12:43 PM |
| creating multiple files | lime | C Programming | 8 | 01-01-2004 02:55 PM |
| How To Make The Program Installed In Program Files Folder? | javacvb | Windows Programming | 4 | 11-05-2003 05:33 PM |
| Creating files then Hiding them or making them Read-Only...how? | Kyoto Oshiro | C++ Programming | 7 | 03-09-2002 07:30 PM |