]> rtime.felk.cvut.cz Git - frescor/fna.git/commitdiff
new makefile system
authorsangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Fri, 19 Oct 2007 09:20:02 +0000 (09:20 +0000)
committersangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Fri, 19 Oct 2007 09:20:02 +0000 (09:20 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fna/trunk@768 35b4ef3e-fd22-0410-ab77-dab3279adceb

Makefile [new file with mode: 0644]
config.mk_example [new file with mode: 0644]
rules.mk [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..79075cd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+all: libfna.a
+include config.mk
+include rules.mk
+
+
diff --git a/config.mk_example b/config.mk_example
new file mode 100644 (file)
index 0000000..1972c06
--- /dev/null
@@ -0,0 +1,19 @@
+# the plaform
+PLATFORM = MARTE_OS
+# the path of the platform
+PLATFORM_PATH = $(HOME)/marte
+# the path for exporting programs linux_arch -> ./
+EXPORT_PATH = $(HOME)/export
+
+# the gcc to use
+CC = mgcc
+# the path to the FRSH directory.
+FRSH_PATH = $(HOME)/frescor/frsh
+# the path to the FOSA directory.
+FOSA_PATH = $(HOME)/frescor/fosa
+# the path to the FNA directory.
+FNA_PATH = $(HOME)/frescor/fna
+# the compilation flags
+CFLAGS = -Wall -g -D$(PLATFORM) -I$(FNA_PATH)/include -I$(FRSH_PATH)/include
+# the library flags
+LDFLAGS = -L$(FNA_PATH)/lib -lfna
\ No newline at end of file
diff --git a/rules.mk b/rules.mk
new file mode 100644 (file)
index 0000000..49ae83c
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,27 @@
+.PHONY: none clean
+
+none:
+       @exec echo -e "\nPlease introduce a target, i.e: 'make test_dtm_xxx.exe'";
+
+%.exe: %.c libfna.a $(FRSH_PATH)/lib/libfrsh.a
+       @exec echo -e "\n>> Building $@: ";
+       @if [ -f $< ]; \
+       then \
+               $(CC) $(CFLAGS) $< $(LDFLAGS); \
+               mv $(EXPORT_PATH)/mprogram $@ &> /dev/null; \
+       fi; # -o $@ (fix marte mgcc)
+       @exec echo ">> End Building $@";
+
+libfna.a:
+       @exec echo -e "\n>> Compiling FNA library (lib/libfna.a):";
+       @make -C $(FNA_PATH)/src all
+       @make -C $(FNA_PATH)/src_rtep librtepfna.a
+       @ar -rc libfna.a $(FNA_PATH)/src/*.o
+       @mv libfna.a $(FNA_PATH)/lib/
+       @exec echo ">> End Compiling FNA library (lib/libfna.a)"
+
+clean:
+       @exec echo -e "\n>> Cleaning... ";
+       @find \( -name '*.[oa]' -or -name '*~*' -or -name 'lib*.a' \
+               -or -name '*.exe' -or -name 'mprogram' -or -name 'a.out' \) -print -delete
+       @exec echo ">> End Cleaning"
\ No newline at end of file