Skip to content

Provides a template makefile for add quickly a build sytem for your project

License

Notifications You must be signed in to change notification settings

bioinfornatics/MakefileForD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

============
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)

About

Provides a template makefile for add quickly a build sytem for your project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published