aboutsummaryrefslogtreecommitdiffstats
path: root/lang/abcl/Makefile
blob: 4a2101fa74f8ebd4de015b26778eebf380b86da3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# New ports collection makefile for:    abcl
# Date created:             22 April 2006
# Whom:                 Frank Fischer
#
# $FreeBSD$
#

PORTNAME=   abcl
DISTVERSION=    0.0.10
PORTREVISION=   1
CATEGORIES= lang lisp java
MASTER_SITES=   http://armedbear.org/

MAINTAINER= fischer.frank@gmail.com
COMMENT=    An implementation of ANSI Common Lisp in Java

SUB_FILES=  abcl
SUB_LIST=   JAVA=${JAVA} ABCL_JAR=${JAVAJARDIR}/abcl.jar

USE_GCC=    3.3+
USE_JAVA=   yes
JAVA_VERSION=   1.4+
USE_LDCONFIG=   yes

do-build: ${WRKSRC}/abcl-src.jar ${WRKSRC}/libabcl.so

do-install:
    @${INSTALL_SCRIPT} -v ${WRKDIR}/abcl ${PREFIX}/bin
    @${INSTALL_DATA} -v ${WRKSRC}/abcl.jar ${JAVAJARDIR}
    @${INSTALL_DATA} -v ${WRKSRC}/abcl-src.jar ${JAVAJARDIR}
    @${INSTALL_DATA} -v ${WRKSRC}/libabcl.so ${LOCALBASE}/lib

.include <bsd.port.pre.mk>

${WRKSRC}/libabcl.so:
    cd ${WRKSRC}/src && \
    ${JAVAH} -o org/armedbear/lisp/native.h org.armedbear.lisp.Native && \
    ${CC} -shared -o ../libabcl.so -O -D_REENTRANT -fpic -I${JAVA_HOME}/include \-I${JAVA_HOME}/include/freebsd org/armedbear/lisp/native.c
${WRKSRC}/abcl-src.jar: ${WRKSRC}/abcl.jar
    cd ${WRKSRC}/src && \
    ${JAR} cmf manifest-abcl ../abcl-src.jar org/armedbear/lisp/*.java && \
    ${JAR} uf ../abcl-src.jar org/armedbear/lisp/java/awt/*.java && \
    ${JAR} uf ../abcl-src.jar org/armedbear/lisp/LICENSE && \
    ${JAR} uf ../abcl-src.jar org/armedbear/lisp/*.lisp

${WRKSRC}/abcl.jar: ${WRKSRC}/src/org/armedbear/lisp/describe-1.cls
    cd ${WRKSRC}/src && \
    ${JAR} cmf manifest-abcl ../abcl.jar org/armedbear/lisp/*.class && \
    ${JAR} uf ../abcl.jar org/armedbear/lisp/java/awt/*.class && \
    ${JAR} uf ../abcl.jar org/armedbear/lisp/LICENSE && \
    ${JAR} uf ../abcl.jar org/armedbear/lisp/*.lisp && \
    ${JAR} uf ../abcl.jar org/armedbear/lisp/*.abcl && \
    ${FIND} . -name '*.cls' | ${XARGS} ${JAR} uf ../abcl.jar

${WRKSRC}/src/org/armedbear/lisp/describe-1.cls: ${WRKSRC}/src/org/armedbear/lisp/Main.class
    cd ${WRKSRC} && \
    ${JAVA} -classpath ./src org.armedbear.lisp.Main --eval "(compile-system :zip nil :quit t)"

${WRKSRC}/src/org/armedbear/lisp/Main.class:
    cd ${WRKSRC} && \
    ${JAVAC} -verbose -classpath ./src ${WRKSRC}/src/org/armedbear/lisp/*.java && \
    ${JAVAC} -verbose -classpath ./src ${WRKSRC}/src/org/armedbear/lisp/java/awt/*.java

delete-build-artifacts:
    ${FIND} ${WRKSRC} -name "*.class" -delete
    ${FIND} ${WRKSRC} -name "*.abcl" -delete
    ${FIND} ${WRKSRC} -name "*.cls" -delete
    ${FIND} ${WRKSRC} -name "native.h" -delete
    ${FIND} ${WRKSRC} -name "libabcl.so" -delete
    ${FIND} ${WRKSRC} -name "build" -delete
list-build-artifacts:
    ${FIND} ${WRKSRC} -name "*.class" -print
    ${FIND} ${WRKSRC} -name "*.abcl" -print
    ${FIND} ${WRKSRC} -name "*.cls" -print
    ${FIND} ${WRKSRC} -name "native.h" -print
    ${FIND} ${WRKSRC} -name "libabcl.so" -print
    ${FIND} ${WRKSRC} -name "build" -print

.include <bsd.port.post.mk>