From e084044a589a654565372e8e977279a086f46989 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 28 May 2012 19:19:39 +0200 Subject: [PATCH] add expat to makefile --- Osmand-kernel/Makefile | 2 ++ Osmand-kernel/expat/.gitignore | 1 + Osmand-kernel/expat/Android.mk | 19 +------------------ Osmand-kernel/expat/Common.mk | 14 ++++++++++++++ Osmand-kernel/expat/Makefile | 24 ++++++++++++++++++++++++ Osmand-kernel/png/Common.mk | 5 ++--- 6 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 Osmand-kernel/expat/.gitignore create mode 100644 Osmand-kernel/expat/Common.mk create mode 100644 Osmand-kernel/expat/Makefile diff --git a/Osmand-kernel/Makefile b/Osmand-kernel/Makefile index 51db13f71d..bd1adcdcd7 100755 --- a/Osmand-kernel/Makefile +++ b/Osmand-kernel/Makefile @@ -3,6 +3,7 @@ build : cd protobuf; $(MAKE) cd png; $(MAKE) cd skia; $(MAKE) + cd expat; $(MAKE) cd freetype; $(MAKE) cd osmand; $(MAKE) @@ -10,5 +11,6 @@ clean : cd protobuf; $(MAKE) clean cd png; $(MAKE) clean cd skia; $(MAKE) clean + cd expat; $(MAKE) clean cd freetype; $(MAKE) clean cd osmand; $(MAKE) clean diff --git a/Osmand-kernel/expat/.gitignore b/Osmand-kernel/expat/.gitignore new file mode 100644 index 0000000000..378eac25d3 --- /dev/null +++ b/Osmand-kernel/expat/.gitignore @@ -0,0 +1 @@ +build diff --git a/Osmand-kernel/expat/Android.mk b/Osmand-kernel/expat/Android.mk index 5ee5a86a86..18b32bebca 100755 --- a/Osmand-kernel/expat/Android.mk +++ b/Osmand-kernel/expat/Android.mk @@ -1,6 +1,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +include $(LOCAL_PATH)/Common.mk ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) LOCAL_MODULE := expat_static @@ -9,26 +10,8 @@ LOCAL_MODULE := expat_static_neon LOCAL_ARM_NEON := true endif -ifeq ($(OSMAND_EXPAT_LOC),) - OSMAND_EXPAT_LOC := ./expat_library -endif -ifeq ($(OSMAND_EXPAT_ABS),) - OSMAND_EXPAT_ABS := $(LOCAL_PATH)/expat_library -endif - ifneq ($(OSMAND_USE_PREBUILT),true) -LOCAL_SRC_FILES := \ - $(OSMAND_EXPAT_LOC)/lib/xmlparse.c \ - $(OSMAND_EXPAT_LOC)/lib/xmlrole.c \ - $(OSMAND_EXPAT_LOC)/lib/xmltok.c - -LOCAL_CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H - -LOCAL_C_INCLUDES += \ - $(OSMAND_EXPAT_ABS) \ - $(OSMAND_EXPAT_ABS)/lib - include $(BUILD_STATIC_LIBRARY) else diff --git a/Osmand-kernel/expat/Common.mk b/Osmand-kernel/expat/Common.mk new file mode 100644 index 0000000000..13a23fd43f --- /dev/null +++ b/Osmand-kernel/expat/Common.mk @@ -0,0 +1,14 @@ +OSMAND_EXPAT_ABS := ./expat_library +OSMAND_EXPAT_LOC := $(LOCAL_PATH)/expat_library + +# Include paths +LOCAL_C_INCLUDES += \ + $(OSMAND_EXPAT_ABS) \ + $(OSMAND_EXPAT_ABS)/lib + +LOCAL_CFLAGS += -fPIC -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H + +LOCAL_SRC_FILES := \ + $(OSMAND_EXPAT_LOC)/lib/xmlparse.c \ + $(OSMAND_EXPAT_LOC)/lib/xmlrole.c \ + $(OSMAND_EXPAT_LOC)/lib/xmltok.c diff --git a/Osmand-kernel/expat/Makefile b/Osmand-kernel/expat/Makefile new file mode 100644 index 0000000000..63a6ed1631 --- /dev/null +++ b/Osmand-kernel/expat/Makefile @@ -0,0 +1,24 @@ +LOCAL_PATH = . +include ../Makefile.vars +include Common.mk + +CPP_FILE_EXTENSION = c +LIBNAME := libexpat.a +PREBUILT_DIR = ../jni-prebuilt/$(os)-$(arch)/ +OBJECTS = $(LOCAL_SRC_FILES:%.$(CPP_FILE_EXTENSION)=build/obj-$(os)-$(arch)/%.o) +CPPFLAGS = $(LOCAL_CFLAGS) $(C_INCLUDES) $(CPP_OS_FLAGS) + +target : $(PREBUILT_DIR)/$(LIBNAME) + +$(PREBUILT_DIR)/$(LIBNAME) : build/$(LIBNAME) + cp build/$(LIBNAME) $(PREBUILT_DIR)/$(LIBNAME) + +build/$(LIBNAME): $(OBJECTS) + ar -rf build/$(LIBNAME) $(OBJECTS) + +build/obj-$(os)-$(arch)/%.o : %.$(CPP_FILE_EXTENSION) $(LOCAL_C_INCLUDES) + @mkdir -p `dirname $@` + $(CXX) -o $@ -c $*.$(CPP_FILE_EXTENSION) $(CPPFLAGS) + +clean: + $(RM) $(OBJECTS) build/$(LIBNAME) \ No newline at end of file diff --git a/Osmand-kernel/png/Common.mk b/Osmand-kernel/png/Common.mk index 1797699a99..ed94da7486 100644 --- a/Osmand-kernel/png/Common.mk +++ b/Osmand-kernel/png/Common.mk @@ -22,8 +22,7 @@ LOCAL_SRC_FILES:= \ $(OSMAND_PNG_LOC)/pngwutil.c LOCAL_C_INCLUDES += \ - $(OSMAND_PNG_ABS)/ + $(OSMAND_EXPAT_ABS) \ + $(OSMAND_EXPAT_ABS)/lib -LOCAL_CFLAGS += -W -Wall -LOCAL_CFLAGS += -fPIC -DPIC -fvisibility=hidden -fpermissive