File: tools_aidl_makefile.patch

package info (click to toggle)
android-platform-frameworks-base 21-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,836 kB
  • ctags: 9,265
  • sloc: cpp: 51,953; java: 19,224; ansic: 612; python: 571; yacc: 300; sh: 246; lex: 212; xml: 146; makefile: 70
file content (43 lines) | stat: -rw-r--r-- 1,046 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
--- /dev/null
+++ b/tools/aidl/Makefile
@@ -0,0 +1,40 @@
+#!/usr/bin/make
+
+CXX = g++
+
+HOST_OS=linux
+include Android.mk
+
+LEX_SOURCES = $(LOCAL_SRC_FILES:.l=.cpp)
+CXX_SOURCES = $(LEX_SOURCES:.y=.cpp)
+OBJECTS = $(CXX_SOURCES:.cpp=.o)
+
+ALL_CXXFLAGS = -O2 -fPIC $(LOCAL_CFLAGS) \
+	-include /usr/include/android/arch/linux-x86/AndroidConfig.h
+ALL_LDFLAGS = -fPIC -Wl,-rpath=/usr/lib/android
+ALL_LIBS = $(LOCAL_LDLIBS) \
+
+CXXFLAGS := $(ALL_CXXFLAGS) $(CXXFLAGS)
+LDFLAGS := $(ALL_LDFLAGS) $(LDFLAGS)
+LIBS := $(ALL_LIBS) $(LIBS)
+
+# from android-platform-build/core/definitions.mk: transform-l-to-cpp
+%.cpp: %.l
+	echo HERE
+	flex -o$@ $<
+
+# from android-platform-build/core/definitions.mk: transform-y-to-cpp
+%.cpp: %.y
+	bison -o $@ $<
+	touch $(@:$1=.hpp)
+	echo '#ifndef '$(@F:$1=_h) > $(@:$1=.h)
+	echo '#define '$(@F:$1=_h) >> $(@:$1=.h)
+	cat $(@:$1=$(YACC_HEADER_SUFFIX)) >> $(@:$1=.h)
+	echo '#endif' >> $(@:$1=.h)
+
+all: $(OBJECTS)
+	$(CXX) $(LDFLAGS) -o aidl $(OBJECTS) $(LIBS)
+
+clean:
+	rm -f $(OBJECTS)
+	rm -f aidl