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