-
Notifications
You must be signed in to change notification settings - Fork 5
/
README
106 lines (80 loc) · 2.67 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
============
MakefileForD
============
This project provides a template build system for use D project
Makefile_lib -> library
Makfile_exe -> executable could to be renamed
Rename Makefile_lib/Makefile_exe to Makefile
In all case you need add command.make in same directory
What you need to do:
--------------------
- take Makefile and command.make
- put it at root of your project
- set variables into Makefile: PROJECT_NAME, AUTHOR, DESCRIPTION, VERSION, LICENSE, SOURCES or ROOT_SOURCE_DIR
It is recommended to put your sources files into a src dir and set var ROOT_SOURCE_DIR to src. Build systeme will found
automatically sources files to build.
Tips:
-----
when you need to write a path like for set SOURCES var use $(PATH_SEP) instead / or \ this allow support both windows and *NIX
How build your project:
-----------------------
In same directory where is the file Makefile do:
$ make
$ make install
Use -j flag for multithreading:
$ make -j
$ make install -j
You can override many varibale as prefix or libdir:
$ make
$ make install PREFIX=/usr LIB_DIR=/usr/lib64
Set DFLAGS
$ make DFLAGS="-w -d -g -O"
Set Include flag
DFLAGS_IMPORT="-Idir1 -Idir2"
Set compiler
$ make DC=dmd
Generate tag for geany
$ make geany-tag
Generate pkgconfig file
$ make pkgfile
Generate Ddoc
You need wrote in root dir a modules.ddoc file, afeter this do
$ make ddoc
Generate shared lib:
$ make shared-lib
Combine targets together:
$ make -j all shared-lib ddoc DFLAGS_IMPORT="-ImySourceDir"
Default target:
all: able to build static lib, doc, header, pkg-confih file
Others targets:
- shared-lib
- ddoc
- geany-tag
How Clean your project:
-----------------------
Each build targets has a clean target by example if you have built with "shared-lib" target use "clean-shared-lib" target
How Install your project:
-------------------------:
Each build targets has a install target by example if you have builti with "shared-lib" target use "install-shared-lib" target
RESUME:
-------
BUILD | CLEAN | INSTALL
___________________________________________________
all | clean | install
static-libs | clean-static-lib | install-static-lib
shared-lib | clean-shared-lib | install-shared-lib
header | clean-header | install-header
doc | clean-doc | install-doc
ddoc | clean-ddoc | install-ddoc
geany-tag | clean-geany-tag | install-geany-tag
pkgfile | clean-pkgfile | install-pkgfile
Feature:
--------
- Support 3 compilers: ldc, gdc, dmd
- Build as static lib or shared
- Generate geany tag
- Generate package config file
- Generate both normal doc and cute doc
TODO:
-----
- Add Windows support (should work)