xforms-development
[Top][All Lists]
Advanced

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

Re: [XForms] Makefile


From: Jens Thoms Toerring
Subject: Re: [XForms] Makefile
Date: Mon, 5 Sep 2011 17:48:19 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Arie,

On Mon, Sep 05, 2011 at 03:54:36PM +0200, Arie van Wettum wrote:
> I installed the xforms-1.0.93sp1 and was able to compile and run the
> examples.
> After this I made a small test program using "fdesign" and would
> like to compile this.
> I have been looking to the demo Makefile and .in and .am files but I
> have not the slightest idee how

They don't really help a lot since they are templates from which
the real Makefiles get created on.

> to create a correct Makefile for my own project. Could anyone help
> me on the way?

Well, as long as XForms has been installed correctly all you
need beside the normal command for compiling a program is an
option for the linker that tells it that it has to link against
the XForms linrary (linforms.so). So, if you have a simple C
program named xyz.c all you need to compile it (assuming you're
using gcc) would be

gcc -o xyz xyz.c -lforms

(and even the '-o xyz' is redundant if you don't mind getting
a file named a.out as the executable instead of a file named
xyz).

And the most simple Makefile would contain the single line

LDLIBS = -lforms

With that you could start the creation of the executable with

make xyz

If you have more than one C file, say a.c and b.c, and the name
of the executable is supposed to be c, the Makefile might look
like this

SOURCES = a.c b.c
TARGET  = c
LDLIBS  = -lforms
$(TARGET): $(SOURCES)
        $(CC) -o $@ $^ $(LDLIBS)

and you would just need to type 'make' at the command prompt.

Of course, there's a nearly infinite amount of variations on
how it could be done;-)
                              Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]