Re: Makefile???, not very good with them.



Yes, its in the same directory.






From: Todd Kulesza <todd dropline net>
To: Hammamur Rahman <hrahman10 hotmail com>
CC: gtk-app-devel-list gnome org
Subject: Re: Makefile???, not very good with them.
Date: Sun, 19 Jan 2003 13:20:20 -0500

Just to double-check... is this Makefile in the same directory as your source code, or is it up one level? For example, if your working direcoty is C:\Src\duv, and your source files are all in C:\Src\duv\src, this Makefile would also need to be in C:\Src\duv\src.

Todd

Hammamur Rahman wrote:
Hi, i followed the description you gave of a make file, thank you it was very helpful. I have re-written my makefile as follows but it is still coming up the same error, where have i gone wrong?:

gcc.exe: no input files
MAKE: *** [duv.exe] Error 1

***********************************************************************

# Compiler
CC=gcc
# Parameters given to the compiler
CFLAGS=-s -mwindows -mno-cygwin -fnative-struct -I"\gtk-2.0" -I"\gtkdeps-2.0" -I"\gtk-2.0\include" -I"\atk-1.0" -I"\pango-1.0" -I"\glib-2.0" -I"\glib-2.0" -I"\glib-2.0\include"

BFLAGS=-lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -lgdi32 -lole32 -luuid -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv

# Standard targets

duv.exe: duv.o dir_stack.o quota_info.o
    $(CC) duv.o dir_stack.o quota_info.o -o duv.exe $(BFLAGS)

duv.o: duv.c duv.h
    $(CC) -c duv.c $(CFLAGS)

dir_stack.o: dir_stack.c dir_stack.h
    $(CC) -c dir_stack.c $(CFLAGS)

quota_info.o: quota_info.c quota_info.h
    $(CC) -c quota_info.c $(CFLAGS)


clean:
    del *.o

*******************************************************************

Thank you!




From: horrorvacui gmx net
To: gtk-app-devel-list gnome org
Subject: Re: Makefile???, not very good with them.
Date: Sun, 19 Jan 2003 15:42:42 +0100

On Sun, 19 Jan 2003 13:57:07 +0000
"Hammamur Rahman" <hrahman10 hotmail com> wrote:

> The error i'm presently getting is:
>
> gcc.exe: no input files
> MAKE: *** [duv.exe] Error 1
>
> I think this a very simple problem.  The main problem is I just don't
> know how to write a makefile properly.  Could you please amend the one
> I'v given and if you have time explain alitlle what each line does.
>

Quite simple. Basically, the Makefile serves to define "targets" and what
to do to obtain them. The simplest posible Makefile, equivalent to running
gcc foo.c -o bar would be:

bar: foo.c
    gcc foo.c -o bar

This makes hardly any sense, but it shows nicely what it's all about. The
target is "bar" (watch the format of the file; a target is something that
begins on the first character of a line, commands begin with an empty
space), and its dependence is what is behind the colon (:). Make checks
the datastamps of both files, and runs the command beneath the target
definition, if:
1) there's no "bar" file
2) the datastamps show that "foo.c" is newer than "bar" - if foo.c is
edited, that is.
Otherwise, make says bar is up to date and does nothing.
Most makefiles use variables for commands. So you can have:
GCC=gcc
CFLAGS=-Wall -pedantic
and the command for the target is then:
    $(GCC) $(CFLAGS) foo.c -o bar

A bit more complex Makefile (a Makefile that makes sense) may look like
this:
GCC=gcc
CFLAGS=-Wall -pedantic

foobar: foo.o bar.o
    $(GCC) $(CFLAGS) foo.o bar.o -o foobar

foo.o: foo.c
    $(GCC) $(CFLAGS) -c foo.c

bar.o: bar.c
    $(GCC) $(CFLAGS) -c bar.c

The first target is the default target. Its dependancies are further
targets, so make jumps to them and checks their dependancies. Whenever it
finds a target that's not up to date, it will execute the command below
the target definition. In this case, if you edit bar.c, it will check
foo.o and do nothing, check bar.o and find it's not up to date, compile
it, and link both object files to foobar.
When invoked without arguments, make will make the default target (the
first appearing), otherwise you can specify them - like "make clean" to
clean the directory of .o files, if you've defined a target "clean":

clean:
    rm -f *.o

The commands executed are those available from the shell you're using. I
use Linux, so you see bash commands here. If you're using dos, use
commands available there, "del *.o" instead of "rm -f *.o" etc...

Cheers

--
Horror Vacui

Registered Linux user #257714

Go get yourself... counted: http://counter.li.org/
- and keep following the GNU.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



_________________________________________________________________
The new MSN 8 is here: Try it free* for 2 months http://join.msn.com/?page=dept/dialup

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


_________________________________________________________________
The new MSN 8 is here: Try it free* for 2 months http://join.msn.com/?page=dept/dialup




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]