1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 22:21:29 +00:00

Link with libnbase.

This commit is contained in:
david
2011-12-19 05:16:22 +00:00
parent 17aaa5b6f1
commit 571a1bab4a
2 changed files with 11 additions and 21 deletions

View File

@@ -3,9 +3,9 @@ srcdir = @srcdir@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ $(DEFS)
CPPFLAGS = @CPPFLAGS@ $(DEFS) -I$(NBASEDIR)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
LIBS = @LIBS@ $(NBASELIB)
DEFS = @DEFS@ -D_FORTIFY_SOURCE=2
APR_CONFIG = @APR_CONFIG@
@@ -14,14 +14,20 @@ SOURCES = nmap-update
C_FILES = $(addsuffix .c,$(SOURCES))
O_FILES = $(addsuffix .o,$(SOURCES))
NBASEDIR = ../nbase
NBASELIB = $(NBASEDIR)/libnbase.a
all: nmap-update
nmap-update: $(O_FILES)
$(CC) -o $@ $(LIBS) $^
$(CC) -o $@ $^ $(LIBS)
%.o: %.c
$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
$(NBASELIB):
cd $(NBASEDIR) && $(MAKE)
clean:
rm -f nmap-update *.o makefile.dep

View File

@@ -10,6 +10,8 @@
#include <sys/stat.h>
#include <unistd.h>
#include "nbase.h"
#include "config.h"
/* See the file tools/examples/minimal_client.c in the Subversion source
@@ -56,24 +58,6 @@ do { \
internal_error("assertion failed: " #expr); \
} while (0)
static void *safe_malloc(size_t len)
{
void *p;
p = malloc(len);
internal_assert(p != NULL);
return p;
}
static void *safe_realloc(void *p, size_t len)
{
p = realloc(p, len);
internal_assert(p != NULL);
return p;
}
static char *safe_strdup(const char *s)
{
char *t;