1 # We need to extend flags to the C compiler and the linker
2 # here. sb-posix, sb-grovel, and sb-bsd-sockets depends upon these
3 # being set on x86_64. Setting these in their Makefiles is not
4 # adequate since, while we're building contrib, they can be compiled
5 # directly via ASDF from a non-C-aware module which has these tricky
6 # ones as dependencies.
8 UNAME:=$(shell uname -s)
9 DEST=$(SBCL_PWD)/obj/sbcl-home/contrib/
10 FASL=$(DEST)/$(SYSTEM).fasl
11 ASD=$(DEST)/$(SYSTEM).asd
14 EXTRA_CFLAGS=-D_XOPEN_SOURCE=500 -D__EXTENSIONS__
15 PATH:=/usr/xpg4/bin:${PATH}
17 ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
18 EXTRA_CFLAGS=-mno-cygwin
19 # GCC 4.x doesn't accept -mno-cygwin.
21 # SBCL can't read cygwin symlinks, and cygwin likes to symlink
22 # gcc. To further complicate things, SBCL can't handle cygwin
24 CC:=$(shell cygpath -m $(shell readlink -fn $(shell which $(CC))))
27 EXTRA_CFLAGS=-D_GNU_SOURCE
30 export CC SBCL EXTRA_CFLAGS EXTRA_LDFLAGS
32 all: $(FASL) $(ASD) $(EXTRA_ALL_TARGETS)
36 $(SBCL) --load ../asdf-stub.lisp \
37 --eval '(asdf::build-asdf-contrib "$(SYSTEM)")'
40 echo "(defsystem :$(SYSTEM) :class require-system)" > $@
43 $(SBCL) --load ../asdf-stub.lisp \
44 --eval '(asdf::test-asdf-contrib "$(SYSTEM)")'
46 # KLUDGE: There seems to be no portable way to tell tar to not to
47 # preserve owner, so chown after installing for the current user.
48 install: $(EXTRA_INSTALL_TARGETS)
49 cp $(FASL) $(ASD) "$(BUILD_ROOT)$(INSTALL_DIR)"