Home | History | Annotate | Download | only in dx
      1 # Copyright 2006 The Android Open Source Project
      2 #
      3 LOCAL_PATH := $(call my-dir)
      4 
      5 # We use copy-file-to-new-target so that the installed
      6 # script files' timestamps are at least as new as the
      7 # .jar files they wrap.
      8 
      9 # This tool is prebuilt if we're doing an app-only build.
     10 ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
     11 
     12 # the dx script
     13 # ============================================================
     14 include $(CLEAR_VARS)
     15 LOCAL_IS_HOST_MODULE := true
     16 LOCAL_MODULE_CLASS := EXECUTABLES
     17 LOCAL_MODULE_TAGS := optional
     18 LOCAL_MODULE := dx
     19 
     20 include $(BUILD_SYSTEM)/base_rules.mk
     21 
     22 $(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/dx$(COMMON_JAVA_PACKAGE_SUFFIX)
     23 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/dx | $(ACP)
     24 	@echo "Copy: $(PRIVATE_MODULE) ($@)"
     25 	$(copy-file-to-new-target)
     26 	$(hide) chmod 755 $@
     27 
     28 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
     29 
     30 # the mainDexClasses rules
     31 # ============================================================
     32 include $(CLEAR_VARS)
     33 LOCAL_IS_HOST_MODULE := true
     34 LOCAL_MODULE_CLASS := EXECUTABLES
     35 LOCAL_MODULE_TAGS := optional
     36 LOCAL_MODULE := mainDexClasses.rules
     37 
     38 include $(BUILD_SYSTEM)/base_rules.mk
     39 
     40 $(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/dx$(COMMON_JAVA_PACKAGE_SUFFIX)
     41 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/mainDexClasses.rules | $(ACP)
     42 	@echo "Copy: $(PRIVATE_MODULE) ($@)"
     43 	$(copy-file-to-new-target)
     44 
     45 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
     46 
     47 installed_mainDexClasses.rules := $(LOCAL_INSTALLED_MODULE)
     48 
     49 # the shrinkedAndroid jar is a library used by the mainDexClasses script
     50 # ============================================================
     51 include $(CLEAR_VARS)
     52 LOCAL_IS_HOST_MODULE := true
     53 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
     54 LOCAL_MODULE_TAGS := optional
     55 LOCAL_MODULE := shrinkedAndroid
     56 LOCAL_BUILT_MODULE_STEM := shrinkedAndroid.jar
     57 LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
     58 
     59 include $(BUILD_SYSTEM)/base_rules.mk
     60 
     61 $(LOCAL_BUILT_MODULE): PRIVATE_PROGUARD_FLAGS:= \
     62   -include $(addprefix $(LOCAL_PATH)/, shrinkedAndroid.proguard.flags)
     63 $(LOCAL_BUILT_MODULE): $(call java-lib-files,android_stubs_current) \
     64                        $(addprefix $(LOCAL_PATH)/, shrinkedAndroid.proguard.flags)| $(PROGUARD)
     65 	@echo Proguard: $@
     66 	$(hide) $(PROGUARD) -injars "$<(**/*.class)" -outjars $@ $(PRIVATE_PROGUARD_FLAGS)
     67 
     68 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
     69 
     70 installed_shrinkedAndroid := $(LOCAL_INSTALLED_MODULE)
     71 
     72 # the mainDexClasses script
     73 # ============================================================
     74 include $(CLEAR_VARS)
     75 LOCAL_IS_HOST_MODULE := true
     76 LOCAL_MODULE_CLASS := EXECUTABLES
     77 LOCAL_MODULE_TAGS := optional
     78 LOCAL_MODULE := mainDexClasses
     79 
     80 include $(BUILD_SYSTEM)/base_rules.mk
     81 
     82 $(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/dx$(COMMON_JAVA_PACKAGE_SUFFIX)
     83 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/mainDexClasses | $(ACP)
     84 	@echo "Copy: $(PRIVATE_MODULE) ($@)"
     85 	$(copy-file-to-new-target)
     86 	$(hide) chmod 755 $@
     87 
     88 $(LOCAL_INSTALLED_MODULE): | $(installed_shrinkedAndroid) $(installed_mainDexClasses.rules)
     89 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
     90 
     91 endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
     92 
     93 # the dexmerger script
     94 # ============================================================
     95 include $(CLEAR_VARS)
     96 LOCAL_IS_HOST_MODULE := true
     97 LOCAL_MODULE_CLASS := EXECUTABLES
     98 LOCAL_MODULE_TAGS := optional
     99 LOCAL_MODULE := dexmerger
    100 
    101 include $(BUILD_SYSTEM)/base_rules.mk
    102 
    103 $(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/dx$(COMMON_JAVA_PACKAGE_SUFFIX)
    104 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/dexmerger | $(ACP)
    105 	@echo "Copy: $(PRIVATE_MODULE) ($@)"
    106 	$(copy-file-to-new-target)
    107 	$(hide) chmod 755 $@
    108 
    109 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
    110 
    111 # the jasmin script
    112 # ============================================================
    113 include $(CLEAR_VARS)
    114 LOCAL_IS_HOST_MODULE := true
    115 LOCAL_MODULE_CLASS := EXECUTABLES
    116 LOCAL_MODULE_TAGS := optional
    117 LOCAL_MODULE := jasmin
    118 
    119 include $(BUILD_SYSTEM)/base_rules.mk
    120 
    121 $(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/jasmin.jar
    122 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/jasmin | $(ACP)
    123 	@echo "Copy: $(PRIVATE_MODULE) ($@)"
    124 	$(copy-file-to-new-target)
    125 	$(hide) chmod 755 $@
    126 
    127 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
    128 
    129 # the jasmin lib
    130 # ============================================================
    131 include $(CLEAR_VARS)
    132 LOCAL_IS_HOST_MODULE := true
    133 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
    134 LOCAL_MODULE_TAGS := optional
    135 LOCAL_MODULE := jasmin.jar
    136 
    137 include $(BUILD_SYSTEM)/base_rules.mk
    138 
    139 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/jasmin.jar | $(ACP)
    140 	@echo "Copy: $(PRIVATE_MODULE) ($@)"
    141 	$(copy-file-to-target)
    142 	$(hide) chmod 644 $@
    143 
    144 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
    145 
    146 # the other stuff
    147 # ============================================================
    148 subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
    149 		junit-tests \
    150 		src \
    151 	))
    152 
    153 include $(subdirs)
    154