|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Need help for an old makefileHello,
I have an old makefile and I want to run it but it can not be "make"ed. How can I convert it to current version of makefile? ![]() TARGET = OCEAN OBJS = main.o jacobcalc.o jacobcalc2.o laplacalc.o \ slave1.o slave2.o multi.o linkup.o subblock.o CFLAGS = -O2 -Olimit 2000 -w LDFLAGS = -lmpc -lm MACROS = ../../../null_macros/c.m4.null x = * $(TARGET): $(OBJS) cc $(OBJS) -o $(TARGET) $(LDFLAGS) .SUFFIXES: .SUFFIXES: .o .c .C .h .H .H.h: m4 ${MACROS} $*.H > $*.h .C.c: m4 $(MACROS) $*.C > $*.c .c.o: cc -c $(CFLAGS) $*.c .C.o: m4 $(MACROS) $*.C > $*.c cc -c $(CFLAGS) $*.c decs.h: decs.H jacobcalc.c: decs.h linkup.c: decs.h slave1.c: decs.h jacobcalc2.c: decs.h main.c: decs.h slave2.c: decs.h laplacalc.c: decs.h multi.c: decs.h subblock.c: decs.h Thanks, |
|
|
Re: Need help for an old makefileHi.
This make file should work. Indeed its syntax is old. GNU make style for implicit rules is described here http://www.gnu.org/software/make/manual/make.html#Implicit-Rules I added little example below. You could me answered much better here http://savannah.gnu.org/mail/?group=make Regards, Dima. On Wed, Apr 16, 2008 at 6:36 PM, mahmoodn <nt_mahmood@...> wrote: > > Hello, > I have an old makefile and I want to run it but it can not be "make"ed. How > can I convert it to current version of makefile?:confused: > .H.h: > m4 ${MACROS} $*.H > $*.h %.h : %.H m4 ${MACROS} $< > $@ |
|
|
Re: Need help for an old makefilemahmoodn wrote:
> Hello, > I have an old makefile and I want to run it but it can not be "make"ed. How > can I convert it to current version of makefile?:confused: What error do you get? We can't help if we don't know what is going wrong. Jim |
|
|
Re: Need help for an old makefile> Indeed its syntax is old.
> .H.h: > m4 ${MACROS} $*.H > $*.h %.h : %.H m4 ${MACROS} $< > $@ The problem is about m4. I get an error "m4 unrecognized". How can I fix it? It seems that oldr versions used m4, but I don't know what happened to it in newer version.
|
|
|
Re: Need help for an old makefilemahmoodn wrote:
> The problem is about m4. I get an error "m4 unrecognized". How can I fix it? > It seems that oldr versions used m4, but I don't know what happened to it in > newer version. m4 is a general purpose text processing program/language. It's not specific to C or gcc, nor is it part of make; it's just a regular command. I'd be surprised if there existed a linux distro or unix vendor in the world that didn't have a m4 package that you can select to install, as it's a standard unix tool going back decades. But this is way off-topic for this list. Brian |
|
|
Re: Need help for an old makefile> But this is way off-topic for this list.
Sorry, What do you mean? Do you think GCC4.1 is able to parse this makefile without any additional switch or command? If yes, then why I get this error? How can I be sure that m4 is installed? Maybe the path is changed?! Thanks,
|
|
|
Re: Need help for an old makefileThe problem is about m4. I get an error "m4 unrecognized". How can I fix it? It seems that oldr versions used m4, but I don't know what happened to it in newer version.
|
|
|
Re: Need help for an old makefilemahmoodn wrote:
> Sorry, What do you mean? Do you think GCC4.1 is able to parse this makefile > without any additional switch or command? If yes, then why I get this error? The compiler does not parse makefiles. 'make' is a totally separate program from the compiler, they are unrelated except for the fact that they are commonly used together. Your problem has nothing to do with gcc though. > How can I be sure that m4 is installed? Maybe the path is changed?! The same ways that you check that any program is installed: - look at the list of packages installed - "m4 --version" or "m4 -v" - "type m4" or "which m4" or "locate m4" - "ls -l /usr/bin/m4" - etc. Brian |
|
|
Re: Need help for an old makefileI am really confused
. This time I tried to make, the error I got is :
cc -c -O2 -Olimit 2000 -w main.c cc: 2000: No such file or directory cc1: error: invalid option argument `-Olimit' make: *** [main.o] Error 1 I can not remember what changes I did in these three days . I did not get the m4 error, but I searched filesystem for it and there is no file "m4".
I placed the files here. if some can compile it, I will very thankful.
|
|
|
Re: Need help for an old makefileDid anyone tried to compile this?
Thanks,
|
|
|
Re: Need help for an old makefileOn Tue, Apr 29, 2008 at 12:11 AM, mahmoodn <nt_mahmood@...> wrote:
> > Did anyone tried to compile this? I couldn't get the files--can you tar and bzip them and post them here? -Tom |
|
|
Re: Need help for an old makefileIt was a rar file. Because I am not in linux, I upload ZIP file.
contiguous_partitions.zip |
|
|
Re: Need help for an old makefileOn Tue, Apr 29, 2008 at 11:46 PM, mahmoodn <nt_mahmood@...> wrote:
> > It was a rar file. Because I am not in linux, I upload ZIP file. There is an apparent m4 macro needed to convert the *.C and *.H files to something usable. It looks as if the BARDEC and similar entities are probably m4 macros. The file you need to find is "c.m4.null". With a google search for "c.m4.null" I got a quick link to this page which is what you probably should be looking at: http://www.capsl.udel.edu/splash/Download.html I'll bet the answers to all your problems are there because it looks like you don't have all the files you need for the project. -Tom |
|
|
Re: Need help for an old makefileI followed the link steps until:
patch -p1 < splash2-modified.patch here is the output of this command: mahmood@magma:splash2$ patch -p1 <splash2-modified.patch The program 'patch' is currently not installed. You can install it by typing: sudo apt-get install patch bash: patch: command not found Is "patch" related to compiler or OS?
|
|
|
Re: Need help for an old makefileOn Thu, 2008-05-01 at 01:12 -0700, mahmoodn wrote: > I followed the link steps until: > patch -p1 < splash2-modified.patch > > here is the output of this command: > mahmood@magma:splash2$ patch -p1 <splash2-modified.patch > The program 'patch' is currently not installed. You can install it by > typing: > sudo apt-get install patch > bash: patch: command not found > > Is "patch" related to compiler or OS? It is not, patch is a utility program to apply patches that were usually created using the 'diff' command. follow the installation instructions provided to you by your distro (debian/ubuntu) and install it to be able to use it. Sivan |
|
|
Re: Need help for an old makefileI installed "patch" command. Then I read http://www.capsl.udel.edu/splash/Download.html. After applying the patch, I run "make" again as the guide said. Here is the error I got
:
m4 -s -Ulen -Uindex /home/ubuntu/splash2/codes/null_macros/c.m4.null decs.H > decs.h /bin/sh: m4: not found make: *** [decs.h] Error 127 Seams that we got back to the first error again!! ![]() ![]() I looked the makefile to trace any changes by that patch. Here is the makefile (I uploaded the directory before, this is the new makefile):
TARGET = OCEAN OBJS = jacobcalc.o jacobcalc2.o laplacalc.o linkup.o main.o multi.o slave1.o slave2.o subblock.o include ../../../Makefile.config decs.h: decs.H jacobcalc.c: decs.h linkup.c: decs.h slave1.c: decs.h jacobcalc2.c: decs.h main.c: decs.h slave2.c: decs.h laplacalc.c: decs.h multi.c: decs.h subblock.c: decs.h The patch I think made some changes to makefile.config. Here it is: CC := gcc CFLAGS := -O3 -pthread -D_POSIX_C_SOURCE=200112 #CFLAGS := -g3 -pthread -D_POSIX_C_SOURCE=200112 CFLAGS := $(CFLAGS) -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization CFLAGS := $(CFLAGS) -Wpadded -Winline -Wpointer-arith -Wsign-compare -Wendif-labels LDFLAGS := -lm BASEDIR := $(HOME)/splash2/codes MACROS := $(BASEDIR)/null_macros/c.m4.null M4 := m4 -s -Ulen -Uindex x = * $(TARGET): $(OBJS) $(CC) $(OBJS) $(CFLAGS) -o $(TARGET) $(LDFLAGS) clean: rm -rf *.c *.h *.o $(TARGET) .SUFFIXES: .SUFFIXES: .o .c .C .h .H .H.h: $(M4) $(MACROS) $*.H > $*.h .C.c: $(M4) $(MACROS) $*.C > $*.c .c.o: $(CC) -c $(CFLAGS) $*.c .C.o: $(M4) $(MACROS) $*.C > $*.c $(CC) -c $(CFLAGS) $*.c annoying m4 is still there.... ![]()
|
|
|
Re: Need help for an old makefileOn 5/5/08, mahmoodn <nt_mahmood@...> wrote:
> > I installed "patch" command. Then I read . After applying the patch, I run > "make" again as the guide said. Here is the error I got:super:: > m4 -s -Ulen -Uindex /home/ubuntu/splash2/codes/null_macros/c.m4.null decs.H > > decs.h > /bin/sh: m4: not found > make: *** [decs.h] Error 127 Your sources are NOT c ready--that's what the m4 macro processor is needed for. (and it has nothing to do with make). You have several choices it seems to me: 1. Install GNU m4. 2. Have someone with m4 generate the *.c and *.h files for you. 3. Manually look at what the macros are doing and make the transformations yourself. If you're going to continue to use GNU programs I suggest doing number 1 (best when done on a Linux or Unix system). Get m4 here: <http://www.gnu.org/software/m4/m4.html> Good luck. -Tom |
|
|
Re: Need help for an old makefileOk I will try. Before downloading and installing m4, I wnat to know is the version of m4 dependent on version of gcc? For example GCC 4.1?
|
|
|
Re: Need help for an old makefileOn 5/5/08, mahmoodn <nt_mahmood@...> wrote:
> > Ok I will try. Before downloading and installing m4, I wnat to know is the > version of m4 dependent on version of gcc? For example GCC 4.1? Well, I've not ever had to install it myself--it has always been standard with the Irix and linux distributions I've used for years (Redhat, then Fedora). Get the package I pointed you to and read the instructions. It will tell you if there are any unusual requirements, but it is probably ported to your existing system with its base C compiler. And by the way, exactly what system/OS are you using that you are having so much trouble with? If it's not Linux, Free BSD, Solaris, or some other *nix, find the nearest one to you and save yourself a lot of trouble. -Tom |
|
|
Re: Need help for an old makefile> what system/OS are you using that you are
>having so much trouble with? Currently I have ubuntu 8.04 (hardy) which I think has GCC 4.2. I also tested it with GCC 3.4 on ubuntu 7.04 (gutsy) to test, because I thought older gcc would help. OK, I will use package manager in ubuntu to find the m4 or I will install it manualy and will tell the result.
|
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |