File: README

package info (click to toggle)
gprolog 1.3.0-6
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 12,708 kB
  • ctags: 8,388
  • sloc: ansic: 57,431; perl: 16,620; sh: 5,900; makefile: 1,284
file content (62 lines) | stat: -rw-r--r-- 1,499 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
		Prolog <-> C interface examples


This directory contains examples presented in the documentation. To build:

	make

examp.pl / examp_c.c: examples calling C from Prolog and C from Prolog

new_main.pl / new_main_c.c: example defining a new main function.


WINDOWS
-------

In Microsoft Windows if you intend to use the gplc compiler as described in
the documentation you need to ascertain the following conditions are
met:

   - for the port compiled with MS Visual C++ (tested with version
     6.0) you'll need to have NASM (the Netwide Assembler available at
     http://nasm.sourceforge.net/) installed and the 'cl' compiler
     (used mainly as linker by GNU Prolog) available in your session
     path.

   - for the ports compiled either with MinGW or Cygwin, the gcc
     toolchain must be installed and available in your session
     path.

Observing these needs you'll also will be able to do the mixed
language programming, as the examples included in the ExamplesC
directory. However you'll need to write your own Makefile as the one
provided is for gplc calling 'gcc' and the options passed by GNU
Prolog will not work, here is an example for nmake and MSVC++ compiler:


GPLC = gplc
CFLAGS=-c -W4

EXECS=examp.exe new_main.exe
.SUFFIXES: .obj .c .wam .pl

.pl.obj:
	$(GPLC) $(CFLAGS) $<

.c.obj:
	$(GPLC) $(CFLAGS) $<

all: $(EXECS)

examp.exe: examp.obj examp_c.obj
	$(GPLC) -o $@ $**

new_main.exe: new_main.obj new_main_c.obj
	$(GPLC) -o $@ $**

clean:
	rm -f $(EXECS) *.obj