makefile changes to allow linking external libs for 3rd party code

This commit is contained in:
Alex Shinn 2012-07-09 20:28:18 +09:00
parent 446f8910f3
commit a2c5d63482
2 changed files with 6 additions and 4 deletions

View file

@ -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)

View file

@ -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