Create unique include file namespace and fix install/uninstall make targets

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2013-07-21 13:08:40 +02:00
1 parent f590237403
commit 49c72c0914
5 files changed
+24 -14

No files matched your search

+19 -9
View File
@@ -28,19 +28,22 @@ CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
STRIP = $(CROSS_COMPILE)strip
CFLAGS += -fPIC -g -Os
CPPFLAGS += -W -Wall
CPPFLAGS += -W -Wall -Iinclude
ARFLAGS = crus
JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.*
LIBNAME = libuev
prefix ?= /usr/local
datadir = $(prefix)/share/doc/libuev
libdir ?= $(prefix)/lib
datadir ?= $(prefix)/share/doc/$(LIBNAME)
incdir ?= $(prefix)/include/$(LIBNAME)
DISTFILES = README LICENSE test.c
INCLUDES = uev.h queue.h
OBJS := libuev.o
SRCS := $(OBJS:.o=.c)
DEPS := $(addprefix .,$(SRCS:.c=.d))
VER = 1
LIBNAME = libuev
SOLIB = $(LIBNAME).so.$(VER)
SYMLIB = $(LIBNAME).so
STATICLIB = $(LIBNAME).a
@@ -69,24 +72,31 @@ $(STATICLIB): Makefile $(OBJS)
@$(AR) $(ARFLAGS) $@ $(OBJS)
install: strip
@install -d $(DESTDIR)$(prefix)/lib
@install -m 0644 $(SOLIB) $(DESTDIR)$(prefix)/lib/
@ln -s $(DESTDIR)$(prefix)/lib/$(SOLIB) $(DESTDIR)$(prefix)/lib/$(SYMLIB)
@install -d $(DESTDIR)$(libdir)
@install $(SOLIB) $(DESTDIR)$(prefix)/lib/$(SOLIB)
@install $(STATICLIB) $(DESTDIR)$(prefix)/lib/$(STATICLIB)
@ln -sf $(SOLIB) $(DESTDIR)$(prefix)/lib/$(SYMLIB)
@install -d $(DESTDIR)$(incdir)
@for file in $(INCLUDES); do \
install -m 0644 include/libuev/$$file $(DESTDIR)$(incdir)/$$file; \
done
@install -d $(DESTDIR)$(datadir)
@for file in $(DISTFILES); do \
install -m 0644 $$file $(DESTDIR)$(datadir)/$$file; \
done
uninstall:
-@$(RM) $(DESTDIR)$(prefix)/lib/$(LIBNAME)*
-@$(RM) -r $(DESTDIR)$(datadir)
-@$(RM) -r $(DESTDIR)$(incdir)
-@$(RM) $(DESTDIR)$(prefix)/lib/$(LIBNAME)*
strip: all
strip: $(TARGET)
@printf " STRIP %s\n" $(TARGET)
@$(STRIP) --strip-unneeded $(TARGET)
test: Makefile test.o $(STATICLIB)
@printf " TEST %s\n" $(STATICLIB)
@$(CC) -g -DNO_DEBUG -o test test.c $(STATICLIB) && ./test
@$(CC) $(CPPFLAGS) -g -o test test.c $(STATICLIB) && ./test
clean:
-@$(RM) $(TARGET) *.o test
View File
File renamed without changes.
+3 -3
View File
@@ -23,8 +23,8 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef LIBUEV_H_
#define LIBUEV_H_
#ifndef LIBUEV_UEV_H_
#define LIBUEV_UEV_H_
#include "queue.h"
@@ -101,7 +101,7 @@ void uev_exit (uev_t *ctx);
uev_t *uev_ctx_create (void);
void uev_ctx_delete (uev_t *uev);
#endif /* LIBUEV_H_ */
#endif /* LIBUEV_UEV_H_ */
/**
* Local Variables:
+1 -1
View File
@@ -34,7 +34,7 @@
#include <time.h>
#include <unistd.h>
#include "libuev.h"
#include "libuev/uev.h"
static clock_t clock_tick = 0;
+1 -1
View File
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <unistd.h> /* intptr_t */
#include "libuev.h"
#include "libuev/uev.h"
static int in, out;
static int period = 0;