mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 11:17:37 +01:00
General cleanup
This commit is contained in:
parent
400f4cd55d
commit
07a58e79ab
80
Makefile
80
Makefile
@ -1,34 +1,62 @@
|
|||||||
|
#
|
||||||
|
# libbsd
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
LIB_FILES = arc4random.c fgetln.c inet_net_pton.c md5c.c \
|
LIB_SRCS = arc4random.c fgetln.c inet_net_pton.c strlcat.c strlcpy.c
|
||||||
strlcat.c strlcpy.c
|
# Disabled until being fixed
|
||||||
|
#LIB_SRCS += md5c.c
|
||||||
|
|
||||||
# All source files have associated object files
|
LIB_INCLUDES = bsd.h
|
||||||
LIBOFILES = $(LIB_FILES:%.c=%.o)
|
|
||||||
|
|
||||||
CFLAGS = -include bsd.h -D_GNU_SOURCE
|
LIB_STATIC_OBJS = $(LIB_SRCS:%.c=%.o)
|
||||||
|
LIB_SHARED_OBJS = $(LIB_SRCS:%.c=%.lo)
|
||||||
|
|
||||||
# all is the default rule
|
LIB_NAME = libbsd
|
||||||
all : libbsd.a \
|
LIB_VERSION_MAJOR = 0
|
||||||
libbsd.so.1
|
LIB_VERSION_MINOR = 0
|
||||||
|
|
||||||
insstall :
|
LIB_STATIC = $(LIB_NAME).a
|
||||||
mkdir -p $(DESTDIR)/usr/lib/
|
|
||||||
mkdir -p $(DESTDIR)/usr/include/
|
|
||||||
install -m644 libbsd.a $(DESTDIR)/usr/lib/
|
|
||||||
install -m644 libbsd.so.1 $(DESTDIR)/usr/lib/
|
|
||||||
install -m644 bsd.h $(DESTDIR)/usr/include/
|
|
||||||
cd $(DESTDIR)/usr/lib/ ; ln -s libbsd.so.1 libbsd.so
|
|
||||||
|
|
||||||
clean :
|
LIB_SHARED_SO = $(LIB_NAME).so
|
||||||
rm -f *.o
|
LIB_SONAME = $(LIB_SHARED_SO).$(LIB_VERSION_MAJOR)
|
||||||
rm -f *.a
|
LIB_SHARED = $(LIB_SONAME).$(LIB_VERSION_MINOR)
|
||||||
rm -f *.so.1
|
|
||||||
|
|
||||||
# remove the old tapestry library and remake the new one
|
MK_CFLAGS = -include bsd.h -D_GNU_SOURCE
|
||||||
libbsd.a: $(LIBOFILES)
|
|
||||||
rm -f $@
|
libs: $(LIB_STATIC) $(LIB_SHARED_SO)
|
||||||
ar cq $@ $(LIBOFILES)
|
|
||||||
|
%.lo: %.c
|
||||||
|
$(CC) -o $@ $(MK_CFLAGS) $(CFLAGS) -DPIC -fPIC -c $<
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) -o $@ $(MK_CFLAGS) $(CFLAGS) -c $<
|
||||||
|
|
||||||
|
$(LIB_STATIC): $(LIB_STATIC_OBJS)
|
||||||
|
ar rcs $@ $^
|
||||||
|
|
||||||
|
$(LIB_SHARED_SO): $(LIB_SONAME)
|
||||||
|
ln -fs $^ $@
|
||||||
|
|
||||||
|
$(LIB_SONAME): $(LIB_SHARED)
|
||||||
|
ln -fs $^ $@
|
||||||
|
|
||||||
|
$(LIB_SHARED): $(LIB_SHARED_OBJS)
|
||||||
|
gcc -shared -Wl,-soname -Wl,$(LIB_SONAME) -o $@ $^
|
||||||
|
|
||||||
|
install: libs
|
||||||
|
mkdir -p $(DESTDIR)/usr/lib/
|
||||||
|
mkdir -p $(DESTDIR)/usr/include/bsd/
|
||||||
|
install -m644 $(LIB_STATIC) $(DESTDIR)/usr/lib/
|
||||||
|
install -m644 $(LIB_SONAME) $(DESTDIR)/usr/lib/
|
||||||
|
install -m644 $(LIB_SHARED) $(DESTDIR)/usr/lib/
|
||||||
|
install -m644 $(LIB_SHARED_SO) $(DESTDIR)/usr/lib/
|
||||||
|
install -m644 $(LIB_INCLUDES) $(DESTDIR)/usr/include/bsd/
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(LIB_STATIC_OBJS)
|
||||||
|
rm -f $(LIB_STATIC)
|
||||||
|
rm -f $(LIB_SHARED_OBJS)
|
||||||
|
rm -f $(LIB_SHARED) $(LIB_SONAME) $(LIB_SHARED_SO)
|
||||||
|
|
||||||
libbsd.so.1: $(LIBOFILES)
|
|
||||||
rm -f $@
|
|
||||||
ld -G -o $@ $(LIBOFILES)
|
|
||||||
|
2
md5c.c
2
md5c.c
@ -39,7 +39,7 @@ __FBSDID("$FreeBSD: src/lib/libmd/md5c.c,v 1.16 2003/06/05 13:17:32 markm Exp $"
|
|||||||
|
|
||||||
//#include <machine/endian.h>
|
//#include <machine/endian.h>
|
||||||
//#include <sys/endian.h>
|
//#include <sys/endian.h>
|
||||||
#include <sys/md5.h>
|
//#include <sys/md5.h>
|
||||||
|
|
||||||
static void MD5Transform(u_int32_t [4], const unsigned char [64]);
|
static void MD5Transform(u_int32_t [4], const unsigned char [64]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user