home: hub: 9ficl

Download patch

ref: 336be867627ca95eb6155222a6f074b73f7a76c4
parent: 7b7fb2a9ad292124fff0df178ab36bfedb58fe88
author: asau <asau@ficl.sf.net>
date: Fri Sep 10 05:20:47 CDT 2010

Generalize Makefiles.

--- /dev/null
+++ b/Makefile
@@ -1,0 +1,60 @@
+OBJECTS= dictionary.o system.o fileaccess.o float.o double.o prefix.o search.o softcore.o stack.o tools.o vm.o primitives.o bit.o lzuncompress.o unix.o utility.o hash.o callback.o word.o extras.o
+HEADERS= ficl.h ficlplatform/unix.h
+#
+# Flags for shared library
+#TARGET= -Dlinux  # riscos MOTO_CPU32 
+SHFLAGS = -fPIC
+CFLAGS= -O $(SHFLAGS)
+CPPFLAGS= $(TARGET) -I.
+CC = cc
+LIB = ar cr
+RANLIB = ranlib
+
+MAJOR = 4
+MINOR = 0.31
+
+ficl: main.o $(HEADERS) libficl.a
+	$(CC) main.o -o ficl -L. -lficl -lm
+
+lib: libficl.so.$(MAJOR).$(MINOR)
+
+# static library build
+libficl.a: $(OBJECTS)
+	$(LIB) libficl.a $(OBJECTS)
+	$(RANLIB) libficl.a
+
+# shared library build
+libficl.so.$(MAJOR).$(MINOR): $(OBJECTS)
+	$(CC) -shared -Wl,-soname,libficl.so.$(MAJOR).$(MINOR) \
+	-o libficl.so.$(MAJOR).$(MINOR) $(OBJECTS)
+	ln -sf libficl.so.$(MAJOR).$(MINOR) libficl.so
+
+main: main.o ficl.h sysdep.h libficl.so.$(MAJOR).$(MINOR)
+	$(CC) main.o -o main -L. -lficl -lm
+	ln -sf libficl.so.$(MAJOR).$(MINOR) libficl.so.$(MAJOR)
+
+# depend explicitly to help finding source files in another subdirectory,
+# and repeat commands since gmake doesn't understand otherwise
+ansi.o: ficlplatform/ansi.c $(HEADERS)
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+unix.o: ficlplatform/unix.c $(HEADERS)
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+#
+#       generic object code
+#
+.SUFFIXES: .cxx .cc .c .o
+
+.c.o:
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+.cxx.o:
+	$(CPP) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+.cc.o:
+	$(CPP) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
+#
+#       generic cleanup code
+#
+clean:
+	rm -f *.o *.a libficl.* ficl