File: Makefile

package info (click to toggle)
scratchbox2 2.0-3.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,732 kB
  • ctags: 5,255
  • sloc: ansic: 19,783; sh: 3,319; cpp: 1,913; perl: 1,463; makefile: 598; python: 182
file content (49 lines) | stat: -rw-r--r-- 1,511 bytes parent folder | download
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
objs := wrappers.o libsb2.o sb_exec.o sb_l10n.o glob.o glob64.o \
	fdpathdb.o procfs.o mempcpy.o

ifeq ($(shell uname -s),Linux)

# binutils gold uses different syntax
ifneq ($(shell { ls -la /usr/bin/ld | grep gold; } && echo yes),yes)
LIBSB2_LDFLAGS = -Wl,-soname=$(LIBSB2_SONAME) \
		-Wl,-retain-symbols-file -Wl,preload/ldexportlist
else
LIBSB2_LDFLAGS = -Wl,-soname=$(LIBSB2_SONAME) \
		-Wl,--retain-symbols-file=preload/ldexportlist
endif

# DO NOT add any libraries that depend on libpthread to
# LIBSB2_LIBS or LIBS!! see the comments in luaif.c.

LIBSB2_LIBS =
SHLIBEXT = so
else
LIBSB2_LIBS =
SHLIBEXT = dylib
endif


$(D)/libsb2.$(SHLIBEXT): $(call O,$(objs))
$(D)/libsb2.$(SHLIBEXT): luaif/libluaif.a luaif/liblua.a
$(D)/libsb2.$(SHLIBEXT): CFLAGS := $(CFLAGS) -fPIC -Wall -W \
		-I$(SRCDIR)/preload -Ipreload/ $(PROTOTYPEWARNINGS)
$(D)/libsb2.$(SHLIBEXT): LDFLAGS := $(LDFLAGS) $(LIBSB2_LDFLAGS)
$(D)/libsb2.$(SHLIBEXT): LIBS := -ldl -lm $(LIBSB2_LIBS)

targets := $(targets) $(D)/libsb2.$(SHLIBEXT)

$(D)/libsb2.o $(D)/sb_l10n.o $(D)/sb_exec.o: preload/exported.h
$(D)/exported.h $(D)/ldexportlist: preload/wrappers.c
$(D)/wrappers.c: preload/interface.master preload/gen-interface.pl
	$(MKOUTPUTDIR)
	$(P)PERL
	$(Q)$(SRCDIR)/preload/gen-interface.pl \
		-W preload/wrappers.c \
		-E preload/exported.h \
		-L preload/ldexportlist \
		<$(SRCDIR)/preload/interface.master

generated := preload/wrappers.c preload/exported.h preload/ldexportlist
.PRECIOUS: $(generated)

CLEAN_FILES += $(generated)