-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
125 lines (95 loc) · 3.55 KB
/
Makefile
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# These line gets substituted with the actual Config::CONFIG items location by extconf.rb
PREFIX = notspecified
BINDIR = $(PREFIX)/bin
JRUBY_VERSION = notspecified
JRUBY_MODULE = 1
INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
INSTALLDIR9000 = $(PREFIX)/lib/ruby/stdlib/rubygems/defaults
OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
ifeq (true,$(shell test -x $(BINDIR)/jruby && echo true))
RAKE=$(BINDIR)/jruby -S rake
else
RAKE=rake
endif
build: .build-post
.build-pre:
.build-post: .build-impl build-exe
build-exe:
@if [ "$(findstring mingw, $(CONF))" ]; then \
${MAKE} -f ${SUB_CONFMK} SUBPROJECTS=${SUBPROJECTS} jruby.exe jrubyw.exe; \
if [ -d ../jruby ]; then cp jruby.exe jrubyw.exe jruby.dll ../jruby/bin/; fi; \
if [ -d D:/work/jruby-dev/jruby ]; then cp jruby.exe jrubyw.exe jruby.dll D:/work/jruby-dev/jruby/bin/; fi; \
fi
jruby.res: resources/jruby.rc
windres $^ -O coff -o $@
jruby.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp utilsfuncswin.cpp jruby.res
$(CXX) $(CXXFLAGS) $^ -s -o $@ $(LDLIBSOPTIONS) -static
jrubyw.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp utilsfuncswin.cpp jruby.res
$(CXX) $(CXXFLAGS) -DJRUBYW -mwindows $^ -s -o $@ $(LDLIBSOPTIONS) -static
install:
@if [ ! -f ./jruby ]; then echo "Please run 'make' first."; exit 1; fi
@if [ x$(BINDIR) = xnotspecified/bin ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
@if [ ! -w $(BINDIR) ]; then echo "'$(BINDIR)' does not exist or cannot write to '$(BINDIR)'."; exit 1; fi
@if [ -f $(BINDIR)/jruby -a ! -w $(BINDIR)/jruby ]; then echo "Cannot write to '$(BINDIR)/jruby'."; exit 1; fi
cp ./jruby $(BINDIR)/jruby
@if [ x$(PREFIX) = xnotspecified ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
@if [ ! -w $(INSTALLDIR) ]; then \
if [ ! -w $(OLDINSTALLDIR) ]; then \
if [ ! -w $(INSTALLDIR9000) ]; then \
echo "Neither '$(INSTALLDIR9000)' nor '$(INSTALLDIR)' nor '$(OLDINSTALLDIR)' exist and are writable"; exit 1; \
else \
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000)"; \
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000); \
fi; \
else \
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR)"; \
cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR); \
fi; \
else \
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR)"; \
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR); \
fi;
test:
$(RAKE)
# Universal binary on OSX
FAT_ARCHES=i386 ppc x86_64
fat: $(FAT_ARCHES)
lipo -create $(foreach arch,$(FAT_ARCHES),build/unix/Darwin-$(arch)/jruby-launcher) -output jruby
$(RAKE)
$(FAT_ARCHES):
$(MAKE) -f $(SUB_CONFMK) CND_PLATFORM=Darwin-$@ CFLAGS="-arch $@" build/unix/Darwin-$@/jruby-launcher
clean: .clean-post
.clean-pre:
-rm -rf build/*
.clean-post: .clean-impl
rm -f *.exe *.res
clobber: .clobber-post
.clobber-pre:
.clobber-post: .clobber-impl
all: .all-post
.all-pre:
.all-post: .all-impl
help: .help-post
.help-pre:
.help-post: .help-impl
# Use the manually-maintained inc/*.mk makefiles.
# Pass NETBEANS=true on the command-line to use NB's generated
# nbproject/*.mk
ifdef NETBEANS
SUB_IMPLMK=nbproject/Makefile-impl.mk
else
SUB_IMPLMK=inc/Makefile-impl.mk
SUB_CONFMK=inc/Makefile-rules.mk
endif
# include project implementation makefile
include $(SUB_IMPLMK)
# Pick conf based on OS. for mingw64, must manually override for now.
ifeq ($(OS),Windows_NT)
CC=gcc
CONF=mingw
else
CONF=unix
endif
ifdef NETBEANS
SUB_CONFMK=nbproject/Makefile-${CONF}.mk
endif