-
Notifications
You must be signed in to change notification settings - Fork 7
/
libsmile.mk
66 lines (53 loc) · 1.34 KB
/
libsmile.mk
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
LIBSMILE_VERSION = 0.2
MAKEFLAGS += -rR --no-print-directory
MAKE += -r
# Avoid funny character set dependencies
unexport LC_ALL
LC_COLLATE=C
LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC
UNAME := $(shell uname)
BINDIR = /usr/bin
SBINDIR = /sbin
LIBDIR = /usr/lib
DATADIR = /usr/share
MANDIR = /usr/man
INCDIR = /usr/include
NASM = nasm
NASMOPT = -Ox
AR = ar
NM = nm
RANLIB = ranlib
OBJDUMP = objdump
OBJCOPY = objcopy
STRIP = strip
CC = gcc
LD = ld
ifeq ($(UNAME), Darwin)
LIBTOOL = glibtool
else
LIBTOOL = libtool
endif
SMILE_INCLUDE = -I$(CURDIR)/include
CFLAGS += -std=c99 -pedantic -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -I. $(SMILE_INCLUDE)
LDFLAGS += -g
PHP = php
RUBY = ruby
API_DIR = $(CURDIR)/api
LIB_DIR = $(CURDIR)/lib
TEST_DIR = $(CURDIR)/test
PHP_DIR = $(CURDIR)/php
RUBY_DIR = $(CURDIR)/ruby
# Common stanza to make gcc generate .*.d dependency files
MAKEDEPS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
# Dependencies that exclude system headers; use whenever we use
# header files from the platform.
UMAKEDEPS = -Wp,-MT,$@,-MMD,$(dir $@).$(notdir $@).d
# DEBUG=1 make
ifdef DEBUG
CFLAGS += -DDEBUG
endif
%.o: %.c
$(CC) $(UMAKEDEPS) $(CFLAGS) -c $< -o $@
%.lo: %.c
$(LIBTOOL) --tag=CC --mode=compile $(CC) $(UMAKEDEPS) $(CFLAGS) -c $< -o $@