⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buildtoolchain-step10-helloworld.txt

📁 这是《嵌入式linux-硬件、软件与接口》一书对应的所有linux方面实例的源代码
💻 TXT
字号:
#!/bin/bash
# buildtoolchain-step10-helloworld v1.2 08/13/02
# www.embeddedlinuxinterfacing.com
#
# The original location of this script is
# http://www.embeddedlinuxinterfacing.com/chapters/03/buildtoolchain
#
# Copyright (C) 2001 by Craig Hollabaugh
# See buildtoolchain script for General Public License statement

if [ ! $BUILDTOOLCHAINENV ]
then
. ./buildtoolchain-environment $1
fi

#
# Step 10 - Checking Tool Chain Build by Cross-Compiling Helloworld
#
date "+%x %X -   Started: $0"
date "+%x %X -   Started: $0" >> $SRCFILELOC/output-build-status


echo creating helloworld.c

cd $BUILDLOC
rm -rf helloworld.*

cat > helloworld.c << ENDOFINPUT
#include <stdio.h>

int main(void)
{
	int i;

	for (i = 1; i < 10; i++)
	{
		printf("Hello world %d times!\n",i);
	}
}

ENDOFINPUT

$TARGET-gcc -g -o helloworld-$TARGET helloworld.c
file helloworld-$TARGET


date "+%x %X - Completed: $0"
date "+%x %X - Completed: $0" >> $SRCFILELOC/output-build-status


#beep
echo -e "\07"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -