Re: XForms: Compile DESIGNER output files?

Richard Kent (kent@hydra.dra.hmg.gb)
Fri, 18 Jul 1997 09:53:51 +0100

To subscribers of the xforms list from "Richard Kent" <kent@hydra.dra.hmg.gb> :

> In my view the designer should either emit all the code as one file or
> else the manual should offer some advice on the compilation step. I am
> more used to compiling each module separately and then linking at the
> end. Most Makefiles follow this philosophy.
>
> I'll know better next time. Thanks for your help.

Well I'm not sure what you mean exactly because I compile the objects for my
XForms code separately and only link at the end (with no problems). I've
included a stripped down version of my makefile below. The fdesign GUI file is
DPTich.fd which, when saved from fdesign produces DPTich.h and DPTich.c. The
important thing to remember is to include DPTich.h in all the other files and
have any global data (which needs to be referenced in several different object
files) declared as "extern" in DPTich_main.h and declared for real in
DPTich_main.cc.

Hope this helps,

TicH

Here's the makefile. The files I manually wrote (as opposed to produced by
fdesign) are called :-

DPTich_main.h - main code header file
(with all extern declarations and includes)
DPTich_main.cc - main code file
DPTich_cb.cc - callbacks

CC = CC
FORMS = ../FORMS
HOMEDIR = /disk1/users/ceerbk
INCDIR = -I. -I$(FORMS) -I/usr/include
LIBDIR = -L$(FORMS) -L/usr/lib
CCFLAGS = $(INCDIR) $(OPTIM) $(DEBUG)
DEBUG = -g3
OPTIM = -O1
LDFLAGS = $(LIBDIR) -lforms -lXpm -lX11 -lm

PROGS = DAP
OBJS = DPTich.o DPTich_cb.o DPTich_main.o

.c.o:
$(CC) $(CCFLAGS) -c $*.c -o $*.o

.cc.o:
$(CC) $(CCFLAGS) -c $*.cc -o $*.o

all: $(PROGS)

DAP: $(OBJS)
$(CC) $(OBJS) -o DAP $(LDFLAGS)

clean:
-rm -f $(OBJS) core

empty:
-rm -f $(OBJS) $(PROGS) core

back:
"cp" *.c ../testbak
"cp" *.cc ../testbak
"cp" *.h ../testbak
"cp" *.fd ../testbak
"cp" makefile ../testbak
lha a $(HOMEDIR)/tich.lha *.c *.cc *.h *.fd makefile

------------------------------------------------------------------------
| Name - Richard Kent |
| EMail - kent@hydra.dra.hmg.gb |
| Plan - All work and no play.....hi ho, hi ho |
------------------------------------------------------------------------

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/