Android移植和交叉编译

来源:互联网 发布:安卓慢镜头拍摄软件 编辑:程序博客网 时间:2024/05/15 23:52

Android.mk

# Copyright 2006 The Android Open Source ProjectLOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES:= \    hello.cLOCAL_SHARED_LIBRARIES := \    liblog \    libcutils \    libdl# temporary hack for broken vendor rilsLOCAL_WHOLE_STATIC_LIBRARIES := \    librilutils_staticLOCAL_MODULE:= helloinclude $(BUILD_EXECUTABLE)

hello.c

#include <stdio.h>#include <stdlib.h>#define cprintf(fmt,args...) do { \    FILE *fp = fopen ("/dev/console", "w"); \        if (fp) { \            fprintf(fp, fmt, ## args ); \            fclose(fp); \        } \} while (0)int main(){    printf("hello world!\n");    return 0;}
0 0
原创粉丝点击