Make INFO's compiler-macro more forgiving.
[sbcl.git] / contrib / asdf-module.mk
blobdf134eafa94d938d2eefa27c3ade1161c14c0cc9
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
13 ifeq (SunOS,$(UNAME))
14 EXTRA_CFLAGS=-D_XOPEN_SOURCE=500 -D__EXTENSIONS__
15 PATH:=/usr/xpg4/bin:${PATH}
16 endif
17 ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
18 # SBCL can't read cygwin symlinks, and cygwin likes to symlink
19 # gcc. To further complicate things, SBCL can't handle cygwin
20 # paths, either.
21 CC:=$(shell cygpath -m $(shell readlink -fn $(shell which $(CC))))
22 endif
23 ifeq (Linux,$(UNAME))
24 EXTRA_CFLAGS=-D_GNU_SOURCE
25 endif
27 export CC SBCL EXTRA_CFLAGS
29 all: $(FASL) $(ASD)
31 $(FASL)::
32 $(MAKE) -C ../asdf
33 $(SBCL) --load ../asdf-stub.lisp \
34 --eval '(asdf::build-asdf-contrib "$(SYSTEM)")'
36 $(ASD)::
37 echo "(defsystem :$(SYSTEM) :class require-system)" > $@
39 test: $(FASL) $(ASD)
40 $(SBCL) --load ../asdf-stub.lisp \
41 --eval '(asdf::test-asdf-contrib "$(SYSTEM)")'
43 # KLUDGE: There seems to be no portable way to tell tar to not to
44 # preserve owner, so chown after installing for the current user.
45 install:
46 cp $(FASL) $(ASD) "$(BUILD_ROOT)$(INSTALL_DIR)"