]> gitweb.factorcode.org Git - factor.git/commitdiff
Makefile better 0.66 release-0-66
authorSlava Pestov <slava@factorcode.org>
Sun, 10 Oct 2004 02:23:23 +0000 (02:23 +0000)
committerSlava Pestov <slava@factorcode.org>
Sun, 10 Oct 2004 02:23:23 +0000 (02:23 +0000)
Makefile
native/factor.h

index 249cb0ef0a603699b81016283a800bea7194f451..b5a00b37bdf1457a17e283ac298fca70feac0311 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,6 @@
-CC = gcc34
-
-# On FreeBSD, to use SDL and other libc_r libs:
-# CFLAGS = -g -Wall -export-dynamic -pthread
-# On PowerPC G5:
-# CFLAGS = -mcpu=970 -mtune=970 -mpowerpc64 -ffast-math -O3
-# On Pentium 4:
-CFLAGS = -march=pentium4 -ffast-math -Os -fomit-frame-pointer -export-dynamic -pthread
-# Add -fomit-frame-pointer if you don't care about debugging
-# CFLAGS = -Os -g -Wall
-
-# On Solaris:
-# LIBS = -lsocket -lnsl -lm
-LIBS = -lm
+CC = gcc
+DEFAULT_CFLAGS = -Os -Wall -export-dynamic -fomit-frame-pointer
+DEFAULT_LIBS = -lm
 
 STRIP = strip
 
@@ -29,9 +18,37 @@ OBJS = native/arithmetic.o native/array.o native/bignum.o \
        native/write.o native/word.o native/compiler.o \
        native/ffi.o
 
+default:
+       @echo "Run 'make' with one of the following parameters:"
+       @echo ""
+       @echo "bsd"
+       @echo "linux"
+       @echo "solaris"
+       @echo ""
+       @echo "Also, you might want to set the SITE_CFLAGS environment"
+       @echo "variable to enable some CPU-specific optimizations; this"
+       @echo "can make a huge difference. Eg:"
+       @echo ""
+       @echo "export SITE_CFLAGS=\"-march=pentium4 -ffast-math\""
+
+bsd:
+       $(MAKE) f \
+               CFLAGS="$(DEFAULT_CFLAGS) -DFFI -pthread" \
+               LIBS="$(DEFAULT_LIBS)"
+
+linux:
+       $(MAKE) f \
+               CFLAGS="$(DEFAULT_CFLAGS) -DFFI" \
+               LIBS="$(DEFAULT_LIBS) -ldl"
+
+solaris:
+       $(MAKE) f \
+               CFLAGS="$(DEFAULT_CFLAGS)" \
+               LIBS="$(DEFAULT_LIBS) -lsocket -lnsl -lm"
+
 f: $(OBJS)
        $(CC) $(LIBS) $(CFLAGS) -o $@ $(OBJS)
-#      $(STRIP) $@
+       $(STRIP) $@
 
 clean:
        rm -f $(OBJS)
index 3e0f6692b39214dba466adf7d3c0113e0f6b1cfe..9472616a4b583c6c7702ede97d6ef839ea390195 100644 (file)
@@ -23,8 +23,6 @@
 #include <sys/time.h>
 #include <netdb.h>
 
-#define FFI
-
 #ifdef FFI
 #include <dlfcn.h>
 #endif /* FFI */