slogcat.c:
#define LOG_TAG "shell"
#include <cutils/log.h>
#include <stdio.h>
int main(int argc, char *argv[ ])
{
char s[256]="";
if (argc > 1){
int i=1;
while (i<argc){
strcat(s ," ");
strcat(s ,argv[i]);
i++;
}
ALOGI("%s\n", s);
}
return 0;
}
************************************
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := slogcat
LOCAL_LDLIBS := -llog
LOCAL_C_INCLUDES += system/core/include/cutils
LOCAL_SHARED_LIBRARIES := libcutils
LOCAL_SRC_FILES := $(call all-subdir-c-files)
include $(BUILD_EXECUTABLE)
***************
mmm external/slogcat