diff --git a/nmap-update/Makefile.in b/nmap-update/Makefile.in index b3668baab..19a86e415 100644 --- a/nmap-update/Makefile.in +++ b/nmap-update/Makefile.in @@ -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 diff --git a/nmap-update/nmap-update.c b/nmap-update/nmap-update.c index 2416e3f86..804dc4bde 100644 --- a/nmap-update/nmap-update.c +++ b/nmap-update/nmap-update.c @@ -10,6 +10,8 @@ #include #include +#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;