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 DEFAULT_LIBS = -lm
ifdef NO_UI
UNIX_UI_LIBS =
else
UNIX_UI_LIBS = -lfreetype -lGL -lX11
endif
WIN32_OBJS = native/win32/ffi.o \ WIN32_OBJS = native/win32/ffi.o \
native/win32/file.o \ native/win32/file.o \
native/win32/misc.o \ native/win32/misc.o \
@ -86,13 +92,13 @@ default:
bsd: bsd:
$(MAKE) $(BINARY) \ $(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -pthread" \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -pthread" \
LIBS="$(DEFAULT_LIBS)" LIBS="$(DEFAULT_LIBS) $(UI_LIBS)"
$(STRIP) $(BINARY) $(STRIP) $(BINARY)
macosx: macosx:
$(MAKE) $(BINARY) \ $(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS)" \ CFLAGS="$(DEFAULT_CFLAGS)" \
LIBS="$(DEFAULT_LIBS) -framework Cocoa -framework OpenGL" \ LIBS="$(DEFAULT_LIBS) -framework Cocoa -framework OpenGL -lfreetype" \
MACOSX=y MACOSX=y
macosx.app: macosx.app:
@ -102,19 +108,19 @@ macosx.app:
linux linux-x86 linux-amd64: linux linux-x86 linux-amd64:
$(MAKE) $(BINARY) \ $(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \
LIBS="-ldl $(DEFAULT_LIBS)" LIBS="-ldl $(DEFAULT_LIBS) $(UNIX_UI_LIBS)"
$(STRIP) $(BINARY) $(STRIP) $(BINARY)
linux-ppc: linux-ppc:
$(MAKE) $(BINARY) \ $(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -mregnames" \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic -mregnames" \
LIBS="-ldl $(DEFAULT_LIBS)" LIBS="-ldl $(DEFAULT_LIBS) $(UNIX_UI_LIBS)"
$(STRIP) $(BINARY) $(STRIP) $(BINARY)
solaris solaris-x86: solaris solaris-x86:
$(MAKE) $(BINARY) \ $(MAKE) $(BINARY) \
CFLAGS="$(DEFAULT_CFLAGS) -D_STDC_C99 -Drestrict=\"\" " \ 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) $(STRIP) $(BINARY)
windows: windows:

View File

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

View File

@ -6,17 +6,10 @@
IN: opengl IN: opengl
USING: alien kernel ; USING: alien kernel ;
{ os "win32" = [
{ [ os "macosx" = ] [ ] } "gl" "opengl32.dll" "stdcall" add-library
{ [ os "win32" = ] [ "glu" "glu32.dll" "stdcall" add-library
"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
TYPEDEF: uint GLenum TYPEDEF: uint GLenum
TYPEDEF: uchar GLboolean TYPEDEF: uchar GLboolean

View File

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

View File

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

View File

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

View File

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

View File

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