---
title: "d相关库自动脚本"
author: "xgene"
date: "2010-10-28T10:31:13Z"
tags: ["C", "C#", "C++", "SVN", "脚本"]
categories: ["编程语言"]
slug: "d"
draft: false
lastmod: "2010-10-28T10:31:13Z"
id: 796242
url: "https://xgene.iteye.com/blog/796242"
---

```java
DHOME=http://svn.dsource.org/projects

all:
        make update
        make build
        make install

update:
        @export PATH=$(shell pwd)/dmd2/bin:${PATH}
        cd dmd2;        svn update
        cd druntime;        svn update
        cd phobos;        svn update

build:
        make -C dmd2/src
        make -C druntime
        make -C phobos

install:
        cp  dmd2/src/dmd        bin
        cp  druntime/import/*        import        -r
        cp  phobos/std                import/        -r

clean:
        make -C dmd2/src        clean
        make -C druntime        clean
        make -C phobos                clean


init:
        svn co $(DHOME)/druntime/trunk                druntime
        svn co $(DHOME)/phobos/trunk/phobos        phobos
        svn co $(DHOME)/dmd/trunk                dmd2
        mkdir -p bin
        mkdir -p lib
        mkdir -p import
```

把这个文件保存为Makefile,执行make init会创建D的基本目录，并下载dmd2,phobos,druntime。
输入make all,会编译这3个库。
来自: <http://bbs.d-programming-language-china.org/thread-966-1-1.html>