Fix make-array transforms.
[sbcl.git] / contrib / asdf-module.mk
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.
7
8 UNAME:=$(shell uname -s)
9 DEST=$(SBCL_PWD)/obj/sbcl-home/contrib/
10 FASL=$(DEST)/$(SYSTEM).fasl
11 ASD=$(DEST)/$(SYSTEM).asd
12
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   EXTRA_CFLAGS=-mno-cygwin
19   # GCC 4.x doesn't accept -mno-cygwin.
20   CC:=gcc-3
21   # SBCL can't read cygwin symlinks, and cygwin likes to symlink
22   # gcc.  To further complicate things, SBCL can't handle cygwin
23   # paths, either.
24   CC:=$(shell cygpath -m $(shell readlink -fn $(shell which $(CC))))
25 endif
26 ifeq (Linux,$(UNAME))
27   EXTRA_CFLAGS=-D_GNU_SOURCE
28 endif
29
30 export CC SBCL EXTRA_CFLAGS EXTRA_LDFLAGS
31
32 all: $(FASL) $(ASD) $(EXTRA_ALL_TARGETS)
33
34 $(FASL)::
35         $(MAKE) -C ../asdf
36         $(SBCL) --load ../asdf-stub.lisp \
37                 --eval '(asdf::build-asdf-contrib "$(SYSTEM)")'
38
39 $(ASD)::
40         echo "(defsystem :$(SYSTEM) :class require-system)" > $@
41
42 test: $(FASL) $(ASD)
43         $(SBCL) --load ../asdf-stub.lisp \
44                 --eval '(asdf::test-asdf-contrib "$(SYSTEM)")'
45
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)"