\[Xt@CFmytest.c
#include "stdio.h"

#define POINT_NUM 100

/**
        MAIN__ function that will be called by the DCL library's main function.
*/
int MAIN__(void)
{
        int     i;
        int     count;
        int     iws;
        float   x[POINT_NUM], y[POINT_NUM];

        count=POINT_NUM;
        for(i=0; i< POINT_NUM; i++) {
                x[i]=i;
                y[i]=x[i]*x[i]+2*x[i]+1;
        }
        /* open the output device */
        printf(" WORKSTATION ID (I)  ? ;\n");
        sgpwsn_( );
        scanf("%d", &iws);
        gropn_(&iws);
        grfrm_( );

        ussttl_("X-TITLE", "x-unit", "Y-TITLE", "y-unit", 7, 6, 7, 6);
        usgrph_(&count, x, y);

        /* close the output device */
        grcls_( );

        return 0;

}  


MakefileF ȉMakefile𗘗pۂɂ́A
ϐ$DCLDIRDCLCꃉCũfBNgɐݒ肵A
$XINCPATH$XLIBPATH$XLIBOPT̃vbgtH[ɏ]Đݒ肷B)

#
#       Makefile for test program
#
.SUFFIXES : .o .c
.c :
        $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS)

XINCPATH        = -I/usr/openwin/include
XLIBPATH        = -L/usr/openwin/lib -R/usr/openwin/lib
XLIBOPT         = -lSM -lICE -lX11

DCLLIBPATH      = -L$(DCLDIR)/lib
F2CLIBPATH      = -L$(DCLDIR)/f2clib 

CFLAGS          = -O $(XINCPATH)
LDFLAGS         = $(XLIBPATH) $(DCLLIBPATH) $(F2CLIBPATH)
LDLIBS          = $(XLIBOPT) -ldcl -lf2c -lm

all: mytest

