summaryrefslogtreecommitdiff
path: root/packages/swt/files/Makefile
blob: 4835f1410dfaea3929e3ff0675685e0f1f9f34c0 (plain)
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
JAVA=swt-gtk-$(RELEASE).jar
LIBRARIES=libswt.so libswt-pi.so libswt-mozilla.so
CLEANFILES=*.files *.jar *.so* *-stamp

RELEASE=OE_SWT_RELEASE
SONAME_VERSION=OE_SWT_API_VERSION

GCJ=false
JAR=fastjar
JAVAC=javac -classpath .
LDCONFIG=/sbin/ldconfig
LN_S=ln -s
RM=rm -f

GCJFLAGS=-O2 -fPIC -fjni -shared

LINK=$(GCJ) $(GCJFLAGS) -o $@ -Wl,-soname=lib$*.so.$(SONAME_VERSION)

# Build without Jars
#all:
#	$(MAKE) -f make_linux.mak make_swt make_atk make_cairo

# Build with Jars 
all: $(JAVA) 
	$(MAKE) -f make_linux.mak make_swt make_atk make_cairo

# all: $(JAVA) $(LIBRARIES)
#	$(MAKE) -f make_linux.mak make_swt make_atk make_gnome make_mozilla

clean distclean:
	$(RM) $(CLEANFILES)
	$(RM) -r swt swt-pi swt-mozilla
	-$(MAKE) -f make_linux.mak clean

.PHONY: all clean distclean

swt.files:
	find org -name *.java \
		-not -path org/eclipse/swt/internal\* \
		-not -path org/eclipse/swt/browser\* | sort > $@

swt-mozilla.files:
	find org/eclipse/swt/browser org/eclipse/swt/internal/mozilla \
		-name *.java | sort > $@

swt-pi.files:
	find org/eclipse/swt/internal -name *.java \
		-not -path org/eclipse/swt/internal/mozilla\* | sort > $@

%-stamp: %.files
	mkdir -p $*
	for i in `cat $<`; do \
		if [ -e $*/$${i%java}class ]; then \
			echo SKIPPING $$i; \
		else \
			echo $(JAVAC) -d $* $$i; \
			$(JAVAC) -d $* $$i || exit $$?; \
		fi \
	done
	touch $@

%.jar: %-stamp
	$(JAR) -C $* -cf $@ .

lib%.so.$(RELEASE): %.jar
	$(LINK) $<
	$(LDCONFIG) -n .

%.so: %.so.$(RELEASE)
	$(LN_S) -f $< $@

swt-gtk-$(RELEASE).jar: swt.jar swt-pi.jar swt-mozilla.jar
	mkdir _jar
	cd _jar && for i in $^; do $(JAR) -xf ../$$i || exit $$?; done
	$(JAR) -C _jar -cf $@ org
	rm -rf _jar

.SECONDARY: