dba81ea337b4da97aecd8ccec2547da20d35a654
[sbcl.git] / contrib / asdf-module.mk
1
2 # We need to extend flags to the C compiler and the linker
3 # here. sb-posix, sb-grovel, and sb-bsd-sockets depends upon these
4 # being set on x86_64. Setting these in their Makefiles is not
5 # adequate since, while we're building contrib, they can be compiled
6 # directly via ASDF from a non-C-aware module which has these tricky
7 # ones as dependencies.
8
9 UNAME:=$(shell uname -s)
10
11 ifeq (SunOS,$(UNAME))
12   EXTRA_CFLAGS=-D_XOPEN_SOURCE=500 -D__EXTENSIONS__
13   PATH:=/usr/xpg4/bin:${PATH}
14 endif
15 ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
16   EXTRA_CFLAGS=-mno-cygwin
17   # GCC 4.x doesn't accept -mno-cygwin.
18   CC:=gcc-3
19   # SBCL can't read cygwin symlinks, and cygwin likes to symlink
20   # gcc.  To further complicate things, SBCL can't handle cygwin
21   # paths, either.
22   CC:=$(shell cygpath -m $(shell readlink -fn $(shell which $(CC))))
23 endif
24 ifeq (Linux,$(UNAME))
25   EXTRA_CFLAGS=-D_GNU_SOURCE
26 endif
27
28 export CC SBCL EXTRA_CFLAGS EXTRA_LDFLAGS
29
30 all: $(EXTRA_ALL_TARGETS)
31         $(MAKE) -C ../asdf
32         $(SBCL) --eval '(defvar *system* "$(SYSTEM)")' --load ../asdf-stub.lisp --eval '(exit)'
33
34 test: all
35         echo "(pushnew :sb-testing-contrib *features*)" \
36              "(asdf:operate (quote asdf:load-op) :$(SYSTEM))" \
37              "(asdf:operate (quote asdf:test-op) :$(SYSTEM))" | \
38           $(SBCL) --eval '(load "../asdf/asdf")'
39
40 # KLUDGE: There seems to be no portable way to tell tar to not to
41 # preserve owner, so chown after installing for the current user.
42 install: $(EXTRA_INSTALL_TARGETS)
43         tar cf - . | ( cd "$(BUILD_ROOT)$(INSTALL_DIR)" && tar xpvf - )
44         find "$(BUILD_ROOT)$(INSTALL_DIR)" -exec chown `id -u`:`id -g` {} \;