提交 a8d6e6bf 编写于 作者: N Nicolas D

Merge pull request #14 from kevin-dot-pyle/master

Build system improvements
......@@ -3,32 +3,40 @@
#
# Compiler settings
CC = gcc
CFLAGS = -O2 -fPIC -Wall -ansi -pedantic
CC ?= gcc
CFLAGS ?= -O2
CFLAGS += -fPIC -Wall -ansi -pedantic
# Ar settings to build the library
AR = ar
AR ?= ar
ARFLAGS = rcv
SHLD = ${CC} ${CFLAGS}
LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
LDFLAGS = -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
LDSHFLAGS = -shared -Wl,-Bsymbolic
LDFLAGS += -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
# Set RANLIB to ranlib on systems that require it (Sun OS < 4, Mac OSX)
# RANLIB = ranlib
RANLIB = true
RM = rm -f
RM ?= rm -f
# Implicit rules
SUFFIXES = .o .c .h .a .so .sl
COMPILE.c=$(CC) $(CFLAGS) -c
COMPILE.c ?= $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
ifndef V
QUIET_AR = @echo "AR $@";
QUIET_CC = @echo "CC $@";
QUIET_LINK = @echo "LINK $@";
QUIET_RANLIB = @echo "RANLIB $@";
endif
.c.o:
@(echo "compiling $< ...")
@($(COMPILE.c) -o $@ $<)
$(QUIET_CC)$(COMPILE.c) $(OUTPUT_OPTION) $<
SRCS = src/iniparser.c \
......@@ -40,11 +48,11 @@ OBJS = $(SRCS:.c=.o)
default: libiniparser.a libiniparser.so
libiniparser.a: $(OBJS)
@($(AR) $(ARFLAGS) libiniparser.a $(OBJS))
@($(RANLIB) libiniparser.a)
$(QUIET_AR)$(AR) $(ARFLAGS) $@ $<
$(QUIET_RANLIB)$(RANLIB) $@
libiniparser.so: $(OBJS)
@$(SHLD) $(LDSHFLAGS) -o $@.0 $(OBJS) $(LDFLAGS) \
$(QUIET_LINK)$(SHLD) $(LDSHFLAGS) $(LDFLAGS) -o $@.0 $(OBJS) \
-Wl,-soname=`basename $@`.0
clean:
......
......@@ -23,6 +23,10 @@
#include <string.h>
#include <unistd.h>
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------
New types
---------------------------------------------------------------------------*/
......@@ -162,4 +166,8 @@ void dictionary_unset(dictionary * d, const char * key);
/*--------------------------------------------------------------------------*/
void dictionary_dump(dictionary * d, FILE * out);
#ifdef __cplusplus
}
#endif
#endif
......@@ -27,6 +27,10 @@
#include "dictionary.h"
#ifdef __cplusplus
extern "C" {
#endif
/*-------------------------------------------------------------------------*/
/**
@brief Get number of sections in a dictionary
......@@ -304,4 +308,8 @@ dictionary * iniparser_load(const char * ininame);
/*--------------------------------------------------------------------------*/
void iniparser_freedict(dictionary * d);
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册