Skip to content

Tutorials

Hyeon-Ho Seo edited this page Feb 17, 2018 · 9 revisions

Tutorials

Contents
Getting ndr-build-env
Can put it where I want?
Write your Makefile
How does it work?
More examples?

Getting ndr-build-env

The simplest way to get ndr-build-env is downloading the latest release. Download an 'ndr-build-env' compressed file; then just extract it in your project root directory!

You can also use git-submodule to get ndr-build-env.

Can put it where I want?

Unfortunately, No :(
You must put it in your project root directory.
Technically, it must be in directory where execute 'make' on

Write your Makefile

Let's start with a Makefile configuration. Say you will use ndr-build-env to build a project named 'SampleProj'.
If you want to execute 'make' from '/src', you must write a '/src/Makefile' like below.

PROJECT_NAME = SampleProj

# TODO: add your handling variables here

include $(CURDIR)/ndr-build-env/ndr.mkroot.mk

And then, add components what you need.

Here is an example case.

Example Project Information

[Project Information]
Project Name : Example_1
Project type : Console Application

[Directory Structure]
TestProject
|--- test
|    |--- test.c
|    |--- test.h
|    |--- Makefile
|--- core
|    |--- main.c
|    |--- Makefile
|--- Makefile
|--- ndr-build-env

[Dependency Graph]
int main (main.c : Entry)
|---> int test_function (test.h : Declare)
|---> int test_function (test.c : Define)

In this case, write your Makefiles like this.

TestProject/Makefile

PROJECT_NAME = Example_1

RDIRS += test
RDIRS += core

include $(CURDIR)/ndr-build-env/ndr.mkroot.mk

TestProject/test/Makefile

OBJ = obj_test

HDRS += test.h
SRCS += test.c

include $(NBE_DIR)/ndr.obj.mk

TestProject/core/Makefile

APP = Example_1

EXTOBJS += obj_test

SRCS += main.c

include $(NBE_DIR)/ndr.app.mk

This sample project will produce a executable file in 'TestProject/native/bin/' as console application named 'Example_1' after 'make' complete.

How does it work?

This section is a Work in Progress :)

More examples?

Reference here