From 5c85d536dcad8cb319999ba7febb8b6c8abd73dd Mon Sep 17 00:00:00 2001 From: darkcoven Date: Mon, 1 Apr 2013 19:48:42 +0200 Subject: [PATCH] Separated lib in two parts : low level and high level. --- .gitignore | 2 ++ Makefile | 12 ++++++++--- lib/src/Makefile | 4 ++-- raw/Makefile | 21 +++++++++++++++++++ {lib/src => raw/include}/attr.h | 0 {lib/src => raw/include}/list.h | 0 {lib/src => raw/include}/protocol.h | 0 raw/src/Makefile | 31 +++++++++++++++++++++++++++++ {lib => raw}/src/attr.c | 1 - {lib => raw}/src/list.c | 0 {lib => raw}/src/protocol.c | 0 11 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 raw/Makefile rename {lib/src => raw/include}/attr.h (100%) rename {lib/src => raw/include}/list.h (100%) rename {lib/src => raw/include}/protocol.h (100%) create mode 100644 raw/src/Makefile rename {lib => raw}/src/attr.c (99%) rename {lib => raw}/src/list.c (100%) rename {lib => raw}/src/protocol.c (100%) diff --git a/.gitignore b/.gitignore index 777604b..5619528 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ *.o *~ *.so +*.a admin admind lib/doc/ +raw/doc/ brouillon diff --git a/Makefile b/Makefile index 73ffad0..8af2203 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,14 @@ -all: lib libdoc cli +all: raw lib libdoc cli -lib: force +raw: force + @+$(MAKE) -C raw lib + + +lib: raw force @+$(MAKE) -C lib lib @@ -12,7 +16,7 @@ libdoc: force @+$(MAKE) -C lib libdoc -cli: force +cli: lib force @+$(MAKE) -C cli @@ -22,10 +26,12 @@ force: clean: + @+$(MAKE) -C raw clean @+$(MAKE) -C lib clean @+$(MAKE) -C cli clean mrproper: clean + @+$(MAKE) -C raw mrproper @+$(MAKE) -C lib mrproper @+$(MAKE) -C cli mrproper diff --git a/lib/src/Makefile b/lib/src/Makefile index 786f827..b88451f 100644 --- a/lib/src/Makefile +++ b/lib/src/Makefile @@ -1,7 +1,7 @@ CC=gcc -CFLAGS=-DBUILD_LIB -I../include/ -W -Wall -Wextra -Os -fno-strict-aliasing -fvisibility=hidden -fPIC -LDFLAGS= +CFLAGS=-DBUILD_LIB -I../../raw/include/ -I../include/ -W -Wall -Wextra -Os -fno-strict-aliasing -fvisibility=hidden -fPIC +LDFLAGS=-L../../raw/ -lrawnsdp EXEC=../libngadmin.so SRC=$(wildcard *.c) diff --git a/raw/Makefile b/raw/Makefile new file mode 100644 index 0000000..9776fb3 --- /dev/null +++ b/raw/Makefile @@ -0,0 +1,21 @@ + + + +all: lib libdoc + + + +lib: + @+$(MAKE) -C src + +libdoc: + doxygen rawnsdp + + +clean: + @rm -rf doc + @+$(MAKE) -C src clean + +mrproper: clean + @+$(MAKE) -C src mrproper + diff --git a/lib/src/attr.h b/raw/include/attr.h similarity index 100% rename from lib/src/attr.h rename to raw/include/attr.h diff --git a/lib/src/list.h b/raw/include/list.h similarity index 100% rename from lib/src/list.h rename to raw/include/list.h diff --git a/lib/src/protocol.h b/raw/include/protocol.h similarity index 100% rename from lib/src/protocol.h rename to raw/include/protocol.h diff --git a/raw/src/Makefile b/raw/src/Makefile new file mode 100644 index 0000000..f9c2c6e --- /dev/null +++ b/raw/src/Makefile @@ -0,0 +1,31 @@ + +CC=gcc +AR=ar +CFLAGS=-I../include/ -I../../lib/include/ -W -Wall -Wextra -Os -fno-strict-aliasing -fvisibility=hidden -fPIC +EXEC=../librawnsdp.a + +SRC=$(wildcard *.c) +OBJ=$(SRC:.c=.o) + + +ifeq ($(DEBUG), yes) +CFLAGS+=-g +else +CFLAGS+=-fomit-frame-pointer +endif + + +$(EXEC): $(OBJ) + $(AR) rcs $@ $^ + +%.o: %.c + $(CC) -c $^ -o $@ $(CFLAGS) + + +clean: + @rm -f *.o + +mrproper: clean + @rm -f $(EXEC) + + diff --git a/lib/src/attr.c b/raw/src/attr.c similarity index 99% rename from lib/src/attr.c rename to raw/src/attr.c index 3e12690..39f8f25 100644 --- a/lib/src/attr.c +++ b/raw/src/attr.c @@ -1,7 +1,6 @@ #include -#include "lib.h" #include "attr.h" #include "protocol.h" diff --git a/lib/src/list.c b/raw/src/list.c similarity index 100% rename from lib/src/list.c rename to raw/src/list.c diff --git a/lib/src/protocol.c b/raw/src/protocol.c similarity index 100% rename from lib/src/protocol.c rename to raw/src/protocol.c -- 2.39.5