mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
makefile changes to allow linking external libs for 3rd party code
This commit is contained in:
parent
446f8910f3
commit
a2c5d63482
2 changed files with 6 additions and 4 deletions
|
@ -50,7 +50,7 @@ lib/%.c: lib/%.stub $(CHIBI_FFI_DEPENDENCIES)
|
||||||
$(CHIBI_FFI) $<
|
$(CHIBI_FFI) $<
|
||||||
|
|
||||||
lib/%$(SO): lib/%.c $(INCLUDES)
|
lib/%$(SO): lib/%.c $(INCLUDES)
|
||||||
$(CC) $(CLIBFLAGS) $(XCPPFLAGS) $(XCFLAGS) -o $@ $< -L. -lchibi-scheme
|
$(CC) $(CLIBFLAGS) $(XCPPFLAGS) $(XCFLAGS) -o $@ $< -L. $(XLIBS) -lchibi-scheme
|
||||||
|
|
||||||
doc-libs: $(HTML_LIBS)
|
doc-libs: $(HTML_LIBS)
|
||||||
|
|
||||||
|
|
|
@ -72,13 +72,14 @@ in C or Scheme. To use it, follow these instructions:
|
||||||
SCM_LIBS = lib/foo/bar.sld lib/foo/bar.scm
|
SCM_LIBS = lib/foo/bar.sld lib/foo/bar.scm
|
||||||
HTML_LIBS = doc/lib/foo/bar.html
|
HTML_LIBS = doc/lib/foo/bar.html
|
||||||
|
|
||||||
5. Add additional flags as necessary to XCPPFLAGS and XCFLAGS.
|
5. Add additional flags as necessary to XCPPFLAGS, XCFLAGS, and XLIBS.
|
||||||
These flags are passed to the compiler and linker when they
|
These flags are passed to the compiler and linker when they
|
||||||
generate the shared library. These should probably include at
|
generate the shared library. These should probably be defined at
|
||||||
least:
|
minimum as:
|
||||||
|
|
||||||
XCPPFLAGS += -I$(PREFIX)/include
|
XCPPFLAGS += -I$(PREFIX)/include
|
||||||
XCFLAGS += -L$(PREFIX)/lib
|
XCFLAGS += -L$(PREFIX)/lib
|
||||||
|
XLIBS +=
|
||||||
|
|
||||||
These additions will ensure that the compiler and linker can
|
These additions will ensure that the compiler and linker can
|
||||||
find the Chibi Scheme include and library files, even if they
|
find the Chibi Scheme include and library files, even if they
|
||||||
|
@ -104,5 +105,6 @@ A complete example is:
|
||||||
|
|
||||||
XCPPFLAGS += -I$(PREFIX)/include
|
XCPPFLAGS += -I$(PREFIX)/include
|
||||||
XCFLAGS += -L$(PREFIX)/lib
|
XCFLAGS += -L$(PREFIX)/lib
|
||||||
|
XLIBS += -lpthread
|
||||||
|
|
||||||
include Makefile.libs
|
include Makefile.libs
|
||||||
|
|
Loading…
Add table
Reference in a new issue