Apply machine instruction fixups to ELF section code
[sbcl.git] / contrib / asdf-module.mk
blobf5f7fb184b55fc02499571198aa3189898459401
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) --eval '(setf (sb-ext:readtable-base-char-preference *readtable*) :both)' \
34 --load ../asdf-stub.lisp \
35 --eval '(asdf::build-asdf-contrib "$(SYSTEM)")'
37 $(ASD)::
38 echo "(defsystem :$(SYSTEM) :class require-system)" > $@
40 test: $(FASL) $(ASD)
41 $(SBCL) --load ../asdf-stub.lisp \
42 --eval '(asdf::test-asdf-contrib "$(SYSTEM)")'
44 # KLUDGE: There seems to be no portable way to tell tar to not to
45 # preserve owner, so chown after installing for the current user.
46 install:
47 cp $(FASL) $(ASD) "$(BUILD_ROOT)$(INSTALL_DIR)"