Mingz技术博客

...

导航

2013年8月1日 #

如何自己编写Makefile

摘要: 如何自己编写Makefile 相信很多朋友都有过这样的经历,看着开源项目中好几页的makefile文件,不知所云。在日常学习和工作中,也有意无意的去回避makefile,能改就不写,能用ide就用ide。其实makefile并没有想象的那么难写,只要你明白了其中的原理,自己实践几次。你也可以自己写makefile,让别人对你头来羡慕的目光。 下面本人介绍一下自己的学习成果,初学阶段,欢迎大家多多指正。 简单的说,makefile定义了一系列的规则来指定,哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译,甚至可以在makefile中执行shell脚本。makefile带来的好处... 阅读全文

posted @ 2013-08-01 22:42 Mingz2013 阅读(291) 评论(0) 推荐(0) 编辑

Getting Started

摘要: https://developers.google.com/v8/get_startedGetting StartedThis document introduces some key V8 concepts and provides ahello worldexample to get you started with V8 code.ContentsAudienceHello WorldRun the Hello World exampleAudienceThis document is intended for C++ programmers who want to embed the 阅读全文

posted @ 2013-08-01 21:55 Mingz2013 阅读(406) 评论(0) 推荐(0) 编辑

Google V8编程详解(五)JS调用C++

摘要: http://blog.csdn.net/feiyinzilgd/article/details/8453230最近由于忙着解决个人单身的问题,时隔这么久才更新第五章。上一章主要讲了Google V8的Context概念。那么其实Google V8的基本概念还有FunctionTemplate, ObjectTemplate等比较重要的基本概念,这些概念将在后续章节中进行渗透。本章主要来讲讲如何通过V8来实现JS调用C++。JS调用C++,分为JS调用C++函数(全局),和调用C++类。JS调用C++函数JS调用C++函数,就是通过FunctionTemplate和ObjectTemplate 阅读全文

posted @ 2013-08-01 20:08 Mingz2013 阅读(2359) 评论(0) 推荐(0) 编辑

Google V8编程详解(四)Context

摘要: http://blog.csdn.net/feiyinzilgd/article/details/8266780上一章,比较略提了下V8的Context。本章将详细的讲解下Context的概念以及用法。ContextContext是V8中一个非常重要的类,理解起来就一句话:JavaScript的执行环境。Context中包了JavaScript内建函数、对象等。所以,通过Context::New出来的Context都是一个全新的干净的JavaScript执行环境,切其他JavaScript环境的更改不影响New出来的Context的JavaScript执行环境,例如:修改JavaScript 阅读全文

posted @ 2013-08-01 20:07 Mingz2013 阅读(1940) 评论(0) 推荐(0) 编辑

Google V8编程详解附录

摘要: Google V8编程详工具函数头文件:utils.h[cpp]view plaincopyprint?#ifndefUTILS_H_#defineUTILS_H_#include"v8.h"#includeusingnamespacev8;usingnamespacestd;v8::HandleReadJS(constchar*name);voidprintValue(Handleresult);#endifReadJS[cpp]view plaincopyprint?v8::HandleReadJS(constchar*name){FILE*file=fopen(nam 阅读全文

posted @ 2013-08-01 20:06 Mingz2013 阅读(697) 评论(0) 推荐(0) 编辑

Google V8编程详解(三)Handle & HandleScope

摘要: 上一章简单的演示了一个Helloworld Demo。里面涉及到了V8的一些基本类型和概念,本章将围绕这个Demo对V8的基本类型和相关概念进行讲解。这里还是先把Demo贴出来便于后面分析:[cpp]view plaincopyprint?#includeusingnamespacev8;intmain(intargc,char*argv[]){//Createastack-allocatedhandlescope.HandleScopehandle_scope;//Createanewcontext.Persistentcontext=Context::New();//Enterthecre 阅读全文

posted @ 2013-08-01 20:05 Mingz2013 阅读(1777) 评论(0) 推荐(0) 编辑

Google V8编程详解(二)HelloWorld

摘要: 转自http://blog.csdn.net/feiyinzilgd/article/details/8248448上一章讲到了V8的编译和安装,这一章开始从一个demo着手。这里选用了官方文档的一个非常简洁的HelloWorld.cc,代码如下:[cpp]view plaincopyprint?#includeusingnamespacev8;intmain(intargc,char*argv[]){//Createastack-allocatedhandlescope.HandleScopehandle_scope;//Createanewcontext.Persistentcontext 阅读全文

posted @ 2013-08-01 20:03 Mingz2013 阅读(1446) 评论(0) 推荐(0) 编辑

Google V8编程详解(一)V8的编译安装(Ubuntu)

摘要: V8的编译比较简单,需要同时安装git和svn.下载V8源码:[html]view plaincopyprint?gitclonegit://github.com/v8/v8.gitv8&&cdv8切换到最新版本:[cpp]view plaincopyprint?gitpull--rebaseoriginmaster安装依赖:[cpp]view plaincopyprint?makedependencies编译:[cpp]view plaincopyprint?makenativemode=debuglibrary=sharedsnapshot=on编译后库文件会在v8/out 阅读全文

posted @ 2013-08-01 20:02 Mingz2013 阅读(1348) 评论(0) 推荐(0) 编辑

Google V8编程详解(序)Cloud App

摘要: 此系列文章转载于此http://blog.csdn.net/feiyinzilgd/article/details/8247723 应用程序发展到今天,应用程序的概念也在不断地发生着变化,WiKi的解释是这样的:“应用程序指为完成某项或多项特定工作的计算机程序”。这里所指的应用程序在软件行的今天,绝大多数指的是需要经过下载安装在本定机器上运行的程序,称之为本地应用。而目前国内很多IT公司都在部署自己的移动互联网战略,主推Cloud App云应用,如阿里云OS、百度云应用。Cloud App正在形成一种新的应用程序形式,即不需要安装即可使用的程序。体现了Cloud App热部署的特点,这也... 阅读全文

posted @ 2013-08-01 19:58 Mingz2013 阅读(483) 评论(0) 推荐(0) 编辑

2013年7月31日 #

makefile:2: *** 遗漏分隔符 。 停止

摘要: from http://hi.baidu.com/��֮��/blog/item/8ec00e2aca65a525d42af11b.html我们在编写完makefile,然后在终端中$make出现“makefile:2: *** 遗漏分隔符 。 停止。”问题,原因是在编写makefile文件时:all:gcc -o helloworld helloworld.cfresh:rm -rf Makefileclean:rm -rf helloworld helloworld.oinstall:cp helloworld /usr/binuninstall:rm -rf /usr/bin/hello 阅读全文

posted @ 2013-07-31 17:42 Mingz2013 阅读(1651) 评论(0) 推荐(0) 编辑