mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 08:51:36 +00:00
Link with libnbase.
This commit is contained in:
@@ -3,9 +3,9 @@ srcdir = @srcdir@
|
|||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
CPPFLAGS = @CPPFLAGS@ $(DEFS)
|
CPPFLAGS = @CPPFLAGS@ $(DEFS) -I$(NBASEDIR)
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@ $(NBASELIB)
|
||||||
DEFS = @DEFS@ -D_FORTIFY_SOURCE=2
|
DEFS = @DEFS@ -D_FORTIFY_SOURCE=2
|
||||||
|
|
||||||
APR_CONFIG = @APR_CONFIG@
|
APR_CONFIG = @APR_CONFIG@
|
||||||
@@ -14,14 +14,20 @@ SOURCES = nmap-update
|
|||||||
C_FILES = $(addsuffix .c,$(SOURCES))
|
C_FILES = $(addsuffix .c,$(SOURCES))
|
||||||
O_FILES = $(addsuffix .o,$(SOURCES))
|
O_FILES = $(addsuffix .o,$(SOURCES))
|
||||||
|
|
||||||
|
NBASEDIR = ../nbase
|
||||||
|
NBASELIB = $(NBASEDIR)/libnbase.a
|
||||||
|
|
||||||
all: nmap-update
|
all: nmap-update
|
||||||
|
|
||||||
nmap-update: $(O_FILES)
|
nmap-update: $(O_FILES)
|
||||||
$(CC) -o $@ $(LIBS) $^
|
$(CC) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
|
$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
|
||||||
|
|
||||||
|
$(NBASELIB):
|
||||||
|
cd $(NBASEDIR) && $(MAKE)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f nmap-update *.o makefile.dep
|
rm -f nmap-update *.o makefile.dep
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "nbase.h"
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
/* See the file tools/examples/minimal_client.c in the Subversion source
|
/* See the file tools/examples/minimal_client.c in the Subversion source
|
||||||
@@ -56,24 +58,6 @@ do { \
|
|||||||
internal_error("assertion failed: " #expr); \
|
internal_error("assertion failed: " #expr); \
|
||||||
} while (0)
|
} 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)
|
static char *safe_strdup(const char *s)
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|||||||
Reference in New Issue
Block a user