2 PROGRAMS
=SVMTeval SVMTlearn SVMTagger
4 all: $(LIBRARY
).a
$(LIBRARY
).so
$(PROGRAMS
)
6 SVMTeval
: src
/bin
/SVMTeval.static.o
$(LIBRARY
).a
$(LIBRARY
).so
7 g
++ $(LDFLAGS
) $(EXTRA_LDFLAGS
) $< -o
$@
-L.
-lsvmtool
++ $(LIBS
)
9 SVMTlearn
: src
/bin
/SVMTlearn.static.o
$(LIBRARY
).a
$(LIBRARY
).so
10 g
++ $(LDFLAGS
) $(EXTRA_LDFLAGS
) $< -o
$@
-L.
-lsvmtool
++ $(LIBS
)
12 SVMTagger
: src
/bin
/SVMTagger.static.o
$(LIBRARY
).a
$(LIBRARY
).so
13 g
++ $(LDFLAGS
) $(EXTRA_LDFLAGS
) $< -o
$@
-L.
-lsvmtool
++ $(LIBS
)
18 SOURCES
= $(shell find src
-maxdepth
1 -name
"*.cc")
21 SHARED_OBJS
= $(SOURCES
:.
cc=.shared.o
)
22 STATIC_OBJS
= $(SOURCES
:.
cc=.static.o
)
24 CFLAGS
= -O2
-g
-std
=c
++0x
-Wall
-Wno-unused-parameter
-Werror
25 EXTRA_CFLAGS
=-I
$(INCLUDE_DIR
)
26 STATIC_CFLAGS
= $(CFLAGS
) $(EXTRA_CFLAGS
)
27 SHARED_CFLAGS
= $(STATIC_CFLAGS
) -fPIC
29 LDFLAGS
= -Wl
,-z
,defs
-Wl
,--as-needed
-Wl
,--no-undefined
33 $(LIBRARY
).so.
$(MAJOR
).
$(MINOR
): $(SHARED_OBJS
)
34 g
++ $(LDFLAGS
) $(EXTRA_LDFLAGS
) -shared \
35 -Wl
,-soname
,$(LIBRARY
).so.
$(MAJOR
) \
36 -o
$(LIBRARY
).so.
$(MAJOR
).
$(MINOR
) \
39 $(LIBRARY
).so
: $(LIBRARY
).so.
$(MAJOR
).
$(MINOR
)
41 ln
-s
$@.
$(MAJOR
).
$(MINOR
) $@.
$(MAJOR
)
45 $(LIBRARY
).a
: $(STATIC_OBJS
)
49 g
++ -o
$@
-c
$+ $(SHARED_CFLAGS
)
52 g
++ -o
$@
-c
$+ $(SHARED_CFLAGS
)
55 gcc
-o
$@
-c
$+ $(SHARED_CFLAGS
)
58 g
++ $(LDFLAGS
) $(EXTRA_LDFLAGS
) -shared
$^
-o
$@
61 g
++ -o
$@
-c
$+ $(STATIC_CFLAGS
)
64 g
++ -o
$@
-c
$+ $(STATIC_CFLAGS
)
67 gcc
-o
$@
-c
$+ $(STATIC_CFLAGS
)
69 S
: $(SOURCES
:.
cc=.S
) src
/bin
/SVMTeval.S src
/bin
/SVMTlearn.S src
/bin
/SVMTagger.S
72 g
++ -Wall
-O0
-o
$@
-S
$+ $(EXTRA_CFLAGS
)
75 g
++ -Wall
-O0
-o
$@
-S
$+ $(EXTRA_CFLAGS
)
78 gcc
-Wall
-O0
-o
$@
-S
$+ $(EXTRA_CFLAGS
)
84 rm -fv
$(STATIC_FIXED_OBJS
)
86 rm -fv
*.so
*.so
* *.a src
/*.o src
/bin
/*.o src
/*.S src
/bin
/*.S
*~
90 install: $(LIBRARY
).a
$(LIBRARY
).so
91 mkdir
-p
"$(DESTDIR)/usr/lib/"
92 cp
-a
*.a
"$(DESTDIR)/usr/lib/"
93 cp
-a
*.so
* "$(DESTDIR)/usr/lib/"
94 mkdir
-p
"$(DESTDIR)/usr/include/"
96 find
$(INCLUDE_DIR
) -name
"*.h" | \
98 t
=`echo "$$f" | sed -e 's|^$(INCLUDE_DIR)/|/usr/include/%PACKAGE%/|'` ; \
100 mkdir
-p
"$(DESTDIR)/$$d" ; \
101 cp
"$$f" "$(DESTDIR)/$$t"; \