zoukankan      html  css  js  c++  java
  • 智能家居项目(2):项目project框架的搭建

    项目管理器:

            Linux中的项目管理器“make”有些类似于windows中的Visual C++里的“project”,它是一种控制编译或者反复编译软件的工具,另外,它还能自己主动管理软件编译的内容、方式和时机,使程序猿可以把精力集中在代码的编写上而不是在源码的组织上。

    |-- Makefile
    |-- Readme.txt(记录文件)
    |-- board(嵌入式应用程序)
    |   |-- include
    |   |   |-- common.h
    |   |   |-- device.h
    |   |   |-- log.h
    |   |   |-- msg.h
    |   |   `-- socket.h
    |   `-- src
    |       `-- Main
    |           |-- Makefile
    |           |-- init.c
    |           |-- log.c
    |           |-- main.c
    |           |-- serial.c
    |           |-- socket.c
    |           |-- socket_dev.c
    |           |-- systeminfo.c
    |           `-- thread.c
    |-- drivers(驱动程序)
    |-- kernel(内核源代码)
    |-- script(脚本文件)
    |   `-- build.sh
    |-- tools(使用到的工具)
    |   `-- images_tools
    |       `-- mkyaffs2image
    |-- u-boot(bootloader源代码)


       初步规划好项目的代码结构,编写makefile文件,并使project可以顺利的编译通过。

    .PHONY:help all uboot kernel app ramdisk system clean drivers
    SRC_PATH=$(shell pwd)
    export SRC_PATH
    
    help:
    	@echo "Usage:"
    	@echo "	make uboot	# Compile UBoot"
    	@echo "	make kernel	# Compile Linux Kernel"
    	@echo "	make ramdisk	# Generate ramdisk.img"
    	@echo "	make system 	# Generate system.img"
    	@echo "	make app	# Build Project applicatins"
    	@echo "	make drivers	# Build drivers"
    	@echo "	make all	# make uboot kernel ramdisk system app drivers"
    
    #$@是Makefile的通配符,代指你前面指定的文件名称,	
    uboot kernel ramdisk system app drivers:
    	@script/build.sh $@
    	
    all:
    	@script/build.sh uboot
    	@script/build.sh kernel
    	@script/build.sh drivers
    	@script/build.sh app
    	@script/build.sh ramdisk
    	@script/build.sh system
    
    # -C 大写,切换到指定文件夹再运行 make 过程,makefile 在这个指定文件夹里面
    clean:	
    	rm -fr images/*
    	rm -fr system/modules/*.ko
    	rm -fr system/app/*
    	make -C board/src/Main
    	make -C u-boot distclean
    	make -C drivers clean
    	make -C kernel clean
    	

    接下来的文章,将具体熟悉board文件夹中的文件。


  • 相关阅读:
    CodeForces 681D Gifts by the List (树上DFS)
    UVa 12342 Tax Calculator (水题,纳税)
    CodeForces 681C Heap Operations (模拟题,优先队列)
    CodeForces 682C Alyona and the Tree (树上DFS)
    CodeForces 682B Alyona and Mex (题意水题)
    CodeForces 682A Alyona and Numbers (水题,数学)
    Virtualizing memory type
    页面跳转
    PHP Misc. 函数
    PHP 5 Math 函数
  • 原文地址:https://www.cnblogs.com/blfshiye/p/4092756.html
Copyright © 2011-2022 走看看