Makefile changes

slava 2006-03-20 00:59:45 +00:00
parent 52f2954767
commit 2ec46c8483
8 changed files with 26 additions and 31 deletions

View File

@ -17,6 +17,12 @@ endif
DEFAULT_LIBS = -lm
ifdef NO_UI
UNIX_UI_LIBS =
else
UNIX_UI_LIBS = -lfreetype -lGL -lX11
endif
WIN32_OBJS = native/win32/ffi.o \
native/win32/file.o \
native/win32/misc.o \
@ -86,13 +92,13 @@ default:
bsd:
$(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -pthread" \
LIBS="$(DEFAULT_LIBS)"
LIBS="$(DEFAULT_LIBS) $(UI_LIBS)"
$(STRIP) $(BINARY)
macosx:
$(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS)" \
LIBS="$(DEFAULT_LIBS) -framework Cocoa -framework OpenGL" \
LIBS="$(DEFAULT_LIBS) -framework Cocoa -framework OpenGL -lfreetype" \
MACOSX=y
macosx.app:
@ -102,19 +108,19 @@ macosx.app:
linux linux-x86 linux-amd64:
$(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \
LIBS="-ldl $(DEFAULT_LIBS)"
LIBS="-ldl $(DEFAULT_LIBS) $(UNIX_UI_LIBS)"
$(STRIP) $(BINARY)
linux-ppc:
$(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -mregnames" \
LIBS="-ldl $(DEFAULT_LIBS)"
LIBS="-ldl $(DEFAULT_LIBS) $(UNIX_UI_LIBS)"
$(STRIP) $(BINARY)
solaris solaris-x86:
$(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -D_STDC_C99 -Drestrict=\"\" " \
LIBS="-ldl -lsocket -lnsl $(DEFAULT_LIBS) -R/opt/PM/lib -R/opt/csw/lib -R/usr/local/lib -R/usr/sfw/lib -R/usr/X11R6/lib -R/opt/sfw/lib"
LIBS="-ldl -lsocket -lnsl $(DEFAULT_LIBS) -R/opt/PM/lib -R/opt/csw/lib -R/usr/local/lib -R/usr/sfw/lib -R/usr/X11R6/lib -R/opt/sfw/lib $(UNIX_UI_LIBS)"
$(STRIP) $(BINARY)
windows:

View File

@ -3,13 +3,9 @@
USING: alien kernel ;
IN: freetype
! Some code to render TrueType fonts with OpenGL.
"freetype" {
{ [ os "macosx" = ] [ "libfreetype.dylib" ] }
{ [ os "win32" = ] [ "freetype6.dll" ] }
{ [ t ] [ "libfreetype.so.6" ] }
} cond "cdecl" add-library
os "win32" = [
"freetype" "freetype6.dll" "cdecl" add-library
] when
LIBRARY: freetype

View File

@ -6,17 +6,10 @@
IN: opengl
USING: alien kernel ;
{
{ [ os "macosx" = ] [ ] }
{ [ os "win32" = ] [
"gl" "opengl32.dll" "stdcall" add-library
"glu" "glu32.dll" "stdcall" add-library
] }
{ [ t ] [
"gl" "libGL.so.1" "cdecl" add-library
"glu" "libGLU.so.1" "cdecl" add-library
] }
} cond
os "win32" = [
"gl" "opengl32.dll" "stdcall" add-library
"glu" "glu32.dll" "stdcall" add-library
]
TYPEDEF: uint GLenum
TYPEDEF: uchar GLboolean

View File

@ -1,6 +1,6 @@
#include "factor.h"
void init_factor(char* image, CELL ds_size, CELL cs_size,
void init_factor(const char* image, CELL ds_size, CELL cs_size,
CELL gen_count,
CELL young_size, CELL aging_size,
CELL code_size, CELL literal_size)
@ -54,7 +54,7 @@ void usage(void)
int main(int argc, char** argv)
{
char *image = NULL;
const char *image = NULL;
CELL ds_size = 128;
CELL cs_size = 128;
CELL generations = 2;

View File

@ -14,7 +14,7 @@ void init_objects(HEADER *h)
bignum_neg_one = h->bignum_neg_one;
}
void load_image(char* filename, int literal_table)
void load_image(const char* filename, int literal_table)
{
FILE* file;
HEADER h;
@ -95,7 +95,7 @@ void load_image(char* filename, int literal_table)
fflush(stdout);
}
bool save_image(char* filename)
bool save_image(const char* filename)
{
FILE* file;
HEADER h;

View File

@ -37,6 +37,6 @@ typedef struct EXT_HEADER {
} HEADER_2;
void init_objects(HEADER *h);
void load_image(char* file, int literal_size);
bool save_image(char* file);
void load_image(const char* file, int literal_size);
bool save_image(const char* file);
void primitive_save_image(void);

View File

@ -7,7 +7,7 @@ void platform_run(void)
void early_init(void) {}
char *default_image_path()
const char *default_image_path(void)
{
return "factor.image";
}

View File

@ -31,7 +31,7 @@ void platform_run(void)
void early_init(void) {}
const char *default_image_path()
const char *default_image_path(void)
{
return "factor.image";
}