Appendix - A Sample program and Makefile
We assume that you have installed the PARI library and include files as explained in Appendix A or in the installation guide. If you chose differently any of the directory names, change them accordingly in the Makefiles.
If the program example that we have given is in the file extgcd.c
, then
a sample Makefile might look as follows. Note that the actual file
examples/Makefile
is more elaborate and you should have a look at it if you
intend to use install()
on custom made functions, see
Label se:install.
CC = cc INCDIR = @includedir LIBDIR = @libdir CFLAGS = -O -I(INCDIR) -L(LIBDIR)
all: extgcd
extgcd: extgcd.c (CC) (CFLAGS) -o extgcd extgcd.c -lpari -lm
We then give the listing of the program examples/extgcd.c
seen in detail in Label se:prog.
file{../examples/extgcd.c}