blob: 5dbca1012744314b0a4b57b9817b0cc709d5ee11 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
OBJECTS= dict.o ficl.o fileaccess.o float.o math64.o prefix.o search.o softcore.o stack.o sysdep.o tools.o unix.o vm.o words.o
HEADERS= ficl.h math64.h sysdep.h
#
# Flags for shared library
TARGET= -Dlinux # riscos MOTO_CPU32
SHFLAGS = -fPIC
CFLAGS= -O -c $(SHFLAGS) $(TARGET)
CC=gcc
LIB = ar cr
RANLIB = ranlib
MAJOR = 3
MINOR = 0.1
ficl: testmain.o ficl.h sysdep.h libficl.a
$(CC) testmain.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
testmain: testmain.o ficl.h sysdep.h libficl.so.$(MAJOR).$(MINOR)
$(CC) testmain.o -o testmain -L. -lficl -lm
ln -sf libficl.so.$(MAJOR).$(MINOR) libficl.so.$(MAJOR)
#
# generic object code
#
.SUFFIXES: .cxx .cc .c .o
.c.o:
$(CC) $(CFLAGS) -c $*.c
.cxx.o:
$(CPP) $(CPFLAGS) -c $*.cxx
.cc.o:
$(CPP) $(CPFLAGS) -c $*.cc
#
# generic cleanup code
#
clean:
rm -f *.o *.a libficl.*
|