4
votes

I know this *** missing separator. is quite common makefile error, which mostly occurs when SPACE is misused instead of TAB. But this case occurs during AOSP build which other guys build well with.

According to some guide for Ubuntu13.10, I tried the AOSP build.

At the very beginning, I got the following error

dalvik/CleanSpec.mk:47: * missing separator. Stop.

/dalvik/CleanSpec.mk

41 # For example:
42 #$(call add-clean-step, rm -rf $(OUT)/target/common/obj/APPS/AndroidTests_intermediates)
43 #$(call add-clean-step, rm -rf $(OUT)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
44 #$(call add-clean-step, find $(OUT) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
45 #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
46 #$(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
47 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
48 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
49 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
50 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
51 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
52 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
53 $(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)

http://androidxref.com/4.4_r1/xref/build/core/cleanbuild.mk

define _add-clean-step
  $(if $(strip $(INTERNAL_CLEAN_BUILD_VERSION)),, \
      $(error INTERNAL_CLEAN_BUILD_VERSION not set))
  $(eval _acs_makefile_prefix := $(lastword $(MAKEFILE_LIST)))
  $(eval _acs_makefile_prefix := $(subst /,_,$(_acs_makefile_prefix)))
  $(eval _acs_makefile_prefix := $(subst .,-,$(_acs_makefile_prefix)))
  $(eval _acs_makefile_prefix := $(_acs_makefile_prefix)_acs)
  $(if $($(_acs_makefile_prefix)),,\
      $(eval $(_acs_makefile_prefix) := $(INTERNAL_CLEAN_BUILD_VERSION)))
  $(eval $(_acs_makefile_prefix) := $($(_acs_makefile_prefix))@)
  $(if $(strip $(2)),$(eval _acs_id := $($(_acs_makefile_prefix))),\
      $(eval _acs_id := $(_acs_makefile_prefix)$($(_acs_makefile_prefix))))
  $(eval INTERNAL_CLEAN_STEPS += $(_acs_id))
  $(eval INTERNAL_CLEAN_STEP.$(_acs_id) := $(1))
  $(eval _acs_id :=)
  $(eval _acs_makefile_prefix :=)
endef
define add-clean-step
$(eval # for build/core/cleanspec.mk, dont use makefile path as part of step id) \
$(if $(filter %/cleanspec.mk,$(lastword $(MAKEFILE_LIST))),\
    $(eval $(call _add-clean-step,$(1),true)),\
    $(eval $(call _add-clean-step,$(1))))
endef

/build/core/cleanspec.mk

subdir_cleanspecs := \
    $(shell build/tools/findleaves.py --prune=$(OUT_DIR) --prune=.repo --prune=.git . CleanSpec.mk)
include $(subdir_cleanspecs)
subdir_cleanspecs :=

If I bypassed the above error, the same error occurs in other module again.

It seems that some my own config could replace TAB with some SPACEs, but I couldn't know the exact reason for this error ?

Thanks in advance. :)

3
In order to debug this problem you have to show us what the add-clean-step variable is set to.MadScientist
@MadScientist Thanks. I updated more add-clean-step in the above.tkhwang

3 Answers

4
votes

TL;DR Please execute make operation in new shell window, not in the same shell after configuring the model.

[ERROR] Execute make in the same shell window after configuring model.

$. build/envsetup.sh 
including device/generic/x86/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including device/generic/armv7-a-neon/vendorsetup.sh
including device/asus/tilapia/vendorsetup.sh
including device/asus/flo/vendorsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/asus/deb/vendorsetup.sh
including device/samsung/manta/vendorsetup.sh
including device/lge/mako/vendorsetup.sh
including device/lge/hammerhead/vendorsetup.sh
including sdk/bash_completion/adb.bash

$ lunch

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_x86-eng
     3. aosp_mips-eng
     4. vbox_x86-eng
     5. mini_x86-userdebug
     6. mini_mips-userdebug
     7. mini_armv7a_neon-userdebug
     8. aosp_tilapia-userdebug
     9. aosp_flo-userdebug
     10. aosp_grouper-userdebug
     11. aosp_deb-userdebug
     12. aosp_manta-userdebug
     13. aosp_mako-userdebug
     14. aosp_hammerhead-userdebug

Which would you like? [aosp_arm-eng] 14

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=aosp_hammerhead
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16M
OUT_DIR=out
============================================

$ make -j4
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=aosp_hammerhead
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16M
OUT_DIR=out
============================================
dalvik/CleanSpec.mk:47: *** missing separator.  Stop.

[OK] Execute make in the new shell window.

$ . build/envsetup.sh 
$ lunch

// Launch new shell window
$ make -j4
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16M
OUT_DIR=out
============================================
including ./abi/cpp/Android.mk ...
including ./art/Android.mk ...
including ./bionic/Android.mk ...
including ./bootable/diskinstaller/Android.mk ...
including ./bootable/recovery/Android.mk ...
including ./build/libs/host/Android.mk ...
including ./build/target/board/Android.mk ...
including ./build/tools/Android.mk ...
including ./cts/Android.mk ...
...

Actually I don't know exactly, but it's just what I observed.
Should the make build be executed in the new shell ?

0
votes

I ran into this same error. In my case it was due to a shell alias echoing text Android wasn't expecting; specifically, my "cd" command was aliased to echo the full path of the new working directory (a more common behavior years ago). I believe this would also happen to people using the CDPATH environment variable which produces similar output.

The build/envsetup.sh script in the Android build system eventually calls the following function:

# Get the value of a build variable as an absolute path.
function get_abs_build_var()
{
    T=$(gettop)
    if [ ! "$T" ]; then
        echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
        return
    fi
    (cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
      make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1)
}

An echo in the "cd" call will combine with the echo from the "make ... dumpvar-abs-$1" call to produce a newline-separated string returned from the function rather than a single path. This causes the top-level make command to fail with the error in question.

Although I think the Android build function could be written better to return just the result from it's inner "make", I left the code as is and amended my "cd" alias to only echo a result when the output path is stdout:

cd () 
{ 
    builtin cd "$@"
    status=$?
    # only echo if stdout goes to a terminal
    [[ -t 1 ]] && echo $PWD
    return $status
}

I hope this helps someone get past this common error.

0
votes

I build android 6.0.1 on mac 10.11, and encounter this error. I don't know if your situation is same as mine, I post the solution here and holp to help others. On osx, the reason is bash session. get_abs_build_var() in build/envsetup.sh will switch bash sessions, and the result contains Saving session... ...saving history...truncating history files... ...completed., so $OUT is not correct at the end. You can create a .bash_sessions_disable file in your home directory to disable this functionality.