.app now includes sources, .dmg is built automatically

slava 2006-03-29 06:34:26 +00:00
parent 0cc07ef41e
commit 279dfc31f5
4 changed files with 32 additions and 40 deletions

View File

@ -1,11 +1,10 @@
CC = gcc CC = gcc
CP = cp
BINARY = f BINARY = f
IMAGE = factor.image IMAGE = factor.image
BUNDLE = Factor.app BUNDLE = Factor.app
BUNDLE_BINARY = $(BUNDLE)/Contents/MacOS/Factor DISK_IMAGE_DIR = Factor-0.81
BUNDLE_IMAGE = $(BUNDLE)/Contents/Resources/factor.image DISK_IMAGE = Factor-0.81.dmg
ifdef DEBUG ifdef DEBUG
DEFAULT_CFLAGS = -g DEFAULT_CFLAGS = -g
@ -83,6 +82,9 @@ default:
@echo "solaris" @echo "solaris"
@echo "windows" @echo "windows"
@echo "" @echo ""
@echo "On Unix, pass NO_UI=1 if you don't want to link with the"
@echo "X11 and OpenGL libraries."
@echo
@echo "Also, you might want to set the SITE_CFLAGS environment" @echo "Also, you might want to set the SITE_CFLAGS environment"
@echo "variable to enable some CPU-specific optimizations; this" @echo "variable to enable some CPU-specific optimizations; this"
@echo "can make a huge difference. Eg:" @echo "can make a huge difference. Eg:"
@ -102,8 +104,21 @@ macosx:
MACOSX=y MACOSX=y
macosx.app: macosx.app:
$(CP) $(BINARY) $(BUNDLE_BINARY) cp $(BINARY) $(BUNDLE)/Contents/MacOS/Factor
$(CP) $(IMAGE) $(BUNDLE_IMAGE)
rm -rf $(BUNDLE)/Contents/Resources/
mkdir -p $(BUNDLE)/Contents/Resources/fonts/
cp -R fonts/*.ttf $(BUNDLE)/Contents/Resources/fonts/
find doc library contrib \( -name '*.factor' \
-o -name '*.facts' \
-o -name '*.txt' \
-o -name '*.html' \
-o -name '*.js' \) \
-exec ./cp_dir {} $(BUNDLE)/Contents/Resources/{} \;
cp $(IMAGE) $(BUNDLE)/Contents/Resources/factor.image
install_name_tool \ install_name_tool \
-id @executable_path/../Frameworks/libfreetype.6.dylib \ -id @executable_path/../Frameworks/libfreetype.6.dylib \
Factor.app/Contents/Frameworks/libfreetype.6.dylib Factor.app/Contents/Frameworks/libfreetype.6.dylib
@ -112,6 +127,13 @@ macosx.app:
@executable_path/../Frameworks/libfreetype.6.dylib \ @executable_path/../Frameworks/libfreetype.6.dylib \
Factor.app/Contents/MacOS/Factor Factor.app/Contents/MacOS/Factor
macosx.dmg:
rm -rf $(DISK_IMAGE_DIR)
mkdir $(DISK_IMAGE_DIR)
cp -R $(BUNDLE) $(DISK_IMAGE_DIR)/$(BUNDLE)
hdiutil create -srcfolder "$(DISK_IMAGE_DIR)" -fs HFS+ \
-volname "$(DISK_IMAGE_DIR)" "$(DISK_IMAGE)"
linux linux-x86 linux-amd64: linux linux-x86 linux-amd64:
$(MAKE) $(BINARY) \ $(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \

View File

@ -3,6 +3,7 @@
- x11 title bars are funny - x11 title bars are funny
- amd64 %box-struct - amd64 %box-struct
- automate .dmg build, put sources there - automate .dmg build, put sources there
- defining methods returning structs in objc
+ portability: + portability:

4
cp_dir Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
mkdir -p `dirname $2`
cp -v $1 $2

View File

@ -1,35 +0,0 @@
How To Set up Factor's UI on Linux
by Daniel Ehrenberg
On the ideal system, Factor's UI works all by itself after bootstrapping. To
get to the REPL, just run
./f factor.image -shell=ui
But on many Linux systems, that doesn't work properly the whole time. The
problem may be an underlying issue with Factor; to test that, try doing just
./f factor.image
and make sure a console REPL sucessfully appears. But it also may be that the
libraries needed to make the UI work aren't properly in place. You'll need four
libraries: libGL, libGLU, libfreetype, and libSDL. If you are missing any of these,
download them. But remember that on any linux system with X11, you should already
have these already. Once you've downloaded these, start
./f factor.image
and type in the following commands:
"gl" load-library drop
"glu" load-library drop
"sdl" load-library drop
"freetype" load-library drop
See which ones of these fail. Each one that failed is a library that isn't on
your computer or is in the wrong place. To fix this, you need to first double
check that you have the library, and then, if you do, get it in the right place.
The directory the libraries should be in varies by the system, but it's usually
/usr/lib or /usr/local/lib. Find one most libraries seem to be in on your system.
Next, you need to use the right name for the file. For your OpenGL library, the
name is libGL.so.1. For GLU, it's libGLU.so.1. For SDL, the name is libSDL.so.
For FreeType, the name is libfreetype.so.6. Make a symbolic link from the current
location of the misplaced library to this new location, under the proper name in
the proper folder. You can do this with the command
ln -s oldlocation newlocation
The old file stays there and the new file mirrors the old one, reflecting all
future changes. Once this link is set up, rebootstrap and all should be well.
If things still do not work, don't hesitate to ask us at #concatenative on
freenode.net.