aboutsummaryrefslogtreecommitdiff
path: root/Makefile.include.in
blob: b70245d1f9a29a762ca2299ed357eb29051941c4 (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
AR=ar
ARFLAGS=crus
RM=rm -rf
SHELL=@SHELL@
ARCH=@ARCH@
abs_top_srcdir=@abs_top_srcdir@
rel_top_srcdir=$(subst $(abspath $(abs_top_srcdir))/,,$(abspath $(CURDIR))/)
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libexecdir=@libexecdir@
sysconfdir=@sysconfdir@
sharedstatedir=@sharedstatedir@
localstatedir=@localstatedir@
libdir=@libdir@
includedir=@includedir@
oldincludedir=@oldincludedir@
datarootdir=@datarootdir@
datadir=@datadir@
infodir=@infodir@
localedir=@localedir@
mandir=@mandir@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
docdir=@docdir@
htmldir=@htmldir@
dvidir=@dvidir@
pdfdir=@pdfdir@
psdir=@psdir@
CXX=@CXX@
CC=@CC@
CXXFLAGS+=@CXXFLAGS@
CFLAGS+=@CFLAGS@
LDFLAGS+=@LDFLAGS@
INCLUDES+=$(sort @INCLUDES@)
INCLUDES+=-I@abs_top_srcdir@/lib
INCLUDES+=-I@abs_top_srcdir@/xbmc
ifneq (@USE_EXTERNAL_FFMPEG@,1)
	INCLUDES+=-I@abs_top_srcdir@/lib/ffmpeg
endif
INCLUDES+=-I@abs_top_srcdir@/xbmc/linux
INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer
DEFINES+= \
	@ARCH_DEFINES@ \
	-D_FILE_DEFINED \
	-D__STDC_CONSTANT_MACROS \
	-DBIN_INSTALL_PATH="\"$(libdir)/xbmc\"" \
	-DINSTALL_PATH="\"$(datarootdir)/xbmc\"" \
	@SDL_DEFINES@ \
	@DEFS@ \

ifeq ($(findstring osx,$(ARCH)), osx)
	export MACOSX_DEPLOYMENT_TARGET=10.4
	INCLUDES+=-I@abs_top_srcdir@/xbmc/osx
endif

ifeq ($(ARCH), powerpc-osx)
	BUNDLE1_O=-lbundle1.o
endif

ifneq ($(V), 1)
	SILENT_CPP=@echo "CPP     $(rel_top_srcdir)$@";
	SILENT_CC =@echo "CC      $(rel_top_srcdir)$@";
	SILENT_S  =@echo "S       $(rel_top_srcdir)$@";
	SILENT_GCH=@echo "GCH     $(rel_top_srcdir)$@";
	SILENT_MM =@echo "MM      $(rel_top_srcdir)$@";
	SILENT_AR =@echo "AR      $(rel_top_srcdir)$@";
	SILENT_LD =@echo "LD      $(rel_top_srcdir)$@";
endif

OBJS+=$(filter %.o,$(SRCS:.cpp=.o))
OBJS+=$(filter %.o,$(SRCS:.c=.o))
OBJS+=$(filter %.o,$(SRCS:.S=.o))
OBJS+=$(filter %.o,$(SRCS:.mm=.o))
OBJS+=$(filter %.o,$(SRCS:.m=.o))

DEPS+=$(filter %.P,$(OBJS:.o=.P))

GEN_DEPS=\
  cp $*.d $*.P \
  && sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
         -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P \
  && rm -f $*.d \
  || ( rm -f $*.P $@ && exit 1 )

%.o: %.cpp
	@rm -f $@
	$(SILENT_CPP) $(CXX) -MF $*.d -MD -c $(CXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ \
	&& $(GEN_DEPS)

%.o: %.cc
	@rm -f $@
	$(SILENT_CPP) $(CXX) -MF $*.d -MD -c $(CXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ \
	&& $(GEN_DEPS)

%.o: %.c
	@rm -f $@
	$(SILENT_CC) $(CC) -MF $*.d -MD -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ \
	&& $(GEN_DEPS)

%.o: %.C
	@rm -f $@
	$(SILENT_CPP) $(CXX) -MF $*.d -MD -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ \
	&& $(GEN_DEPS)

%.o: %.S
	@rm -f $@
	$(SILENT_CC) $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< -o $@


%.h.gch : %.h
	$(SILENT_GCH) $(CXX) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< -o $@

%.o: %.m
	@rm -f $@
	$(SILENT_MM) $(CXX) -MF $*.d -MD -c $(CXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ \
	&& $(GEN_DEPS)

%.o: %.mm
	@rm -f $@
	$(SILENT_MM) $(CXX) -MF $*.d -MD -c $(CXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ \
	&& $(GEN_DEPS)


.PHONY : lib pch clean distclean distclean_evil

$(LIB): $(OBJS)
	$(SILENT_AR) $(AR) $(ARFLAGS) $(LIB) $(OBJS)

pch: $(PCH:.h=.h.gch)
	for d in $(DIRS); do (cd "$$d"; $(MAKE) pch ); done

clean: 
	$(RM) $(OBJS) *.o $(LIB) $(SLIB) $(CLEAN_FILES) $(PCH:.h=.h.gch) $(DEPS)
	for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" clean); fi ); done

distclean:
	$(RM) $(OBJS) *.o $(LIB) $(SLIB) $(STATICLIB) $(CLEAN_FILES) $(DISTCLEAN_FILES) $(PCH:.h=.h.gch) $(DEPS)
	for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" distclean || $(MAKE) -C "$$d" clean); fi ); done
	if [ "$(shell pwd -P)" = "$(abs_top_srcdir)" ] || \
	   [ "$(shell pwd)" = "$(abs_top_srcdir)" ]; then rm -f $(AUTOGENERATED_MAKEFILES) Makefile.include Makefile; fi