-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
86 lines (61 loc) · 1.77 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
topdir = .
include $(topdir)/libsmile.mk
############
# libsmile #
############
LIBSMILE_H = $(LIB_DIR)/decode.h $(API_DIR)/smile.h
LIBSMILE_OBJS = $(LIB_DIR)/decode.o $(LIB_DIR)/block.o
SLIBSMILE_OBJS = $(LIB_DIR)/decode.lo $(LIB_DIR)/block.lo
LIBSMILE = $(CURDIR)/libsmile.la
all: $(UNSMILE) $(LIBSMILE)
$(LIBSMILE): $(SLIBSMILE_OBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SLIBSMILE_OBJS)
###########
# unsmile #
###########
UNSMILE = unsmile
UNSMILE_OBJS = $(CURDIR)/tools/unsmile.o $(CURDIR)/tools/usage.o
$(UNSMILE): $(SLIBSMILE_OBJS) $(UNSMILE_OBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SLIBSMILE_OBJS) $(UNSMILE_OBJS)
check: unsmile
@$(TEST_DIR)/test.sh
clean: clean-php
@find . \
\( -name '*.[oas]' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.lo' -o -name '.tmp_*.o.*' \
-o -name $(UNSMILE) -o -name `basename $(LIBSMILE)` \) -type f -print | xargs rm -f && \
rm -rf $(UNSMILE).dSYM $(CURDIR)/.libs
#################
# PHP Extension #
#################
PHP_LIBSMILE = $(PHP_DIR)/modules/libsmile.so
php: $(PHP_LIBSMILE)
$(PHP_LIBSMILE): $(LIBSMILE)
@cd $(PHP_DIR) && \
phpize && \
./configure --enable-libsmile && \
$(MAKE)
check-php:
$(PHP) -c $(TEST_DIR) $(TEST_DIR)/test.php
install-php:
@cp -f $(PHP_LIBSMILE) `php-config --extension-dir`
clean-php:
@cd $(PHP_DIR) && \
phpize --clean && \
rm -f config.h.in~
##################
# Ruby Extension #
##################
RUBY_LIBSMILE = $(RUBY_DIR)/libsmile.bundle
ruby: $(RUBY_LIBSMILE)
$(RUBY_LIBSMILE): $(LIBSMILE)
@cd $(RUBY_DIR) && \
$(RUBY) extconf.rb &&
$(MAKE)
check-ruby:
$(RUBY) $(TEST_DIR)/test.rb
install-ruby:
clean-ruby:
@cd $(RUBY_DIR) && \
$(MAKE) clean && \
rm -f Makefile