1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 00:19:01 +00:00

Use more structure in defining Nmap version number

This commit is contained in:
dmiller
2021-07-19 23:06:50 +00:00
parent c23d0f8345
commit bd81beac1c
4 changed files with 16 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
# Extract the version string from nmap.h.
export NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
export NMAP_VERSION := $(shell echo NMAP_VERSION | $(CPP) -imacros nmap.h - | sed -n '$$s/[" ]//g;$$p')
NMAP_PLATFORM=@host@
datarootdir = @datarootdir@
prefix = @prefix@

View File

@@ -1,8 +1,8 @@
# This makefile builds a disk image (.dmg) containing the installer for Nmap,
# Zenmap, Ncat, and Ndiff.
NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' ../nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
NMAP_NUM_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_NUM_VERSION' ../nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
NMAP_VERSION := $(shell echo NMAP_VERSION | $(CPP) -imacros nmap.h - | sed -n '$$s/[" ]//g;$$p')
NMAP_VERSION := $(shell echo NMAP_NUM_VERSION | $(CPP) -imacros nmap.h - | sed -n '$$s/[" ]//g;$$p')
#OSX_VERSION=$(shell sw_vers -productVersion | cut -d'.' -f1,2 | tr -d ' ')
OSX_VERSION=10.11
OSX_MIN_VERSION = 10.9

View File

@@ -5,8 +5,8 @@ VCEXPRESS := $(shell reg query "HKEY_CLASSES_ROOT\\Applications\\devenv.exe\\she
SIGNTOOL := $(shell reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1" /v "InstallationFolder" | egrep InstallationFolder | cut -d ' ' -f13- | sed 's%\\%/%g' | tr -d '\r\n' | sed 's%$$%bin/x86/signtool.exe%')
NMAPDIR=..
NMAPDIR_WIN=$(shell echo '$(NMAPDIR)' | sed 's|/cygdrive/\(.\)|\1:|;s|/|\\|g')
export NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' $(NMAPDIR)/nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
export NMAP_NUM_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_NUM_VERSION' $(NMAPDIR)/nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
export NMAP_VERSION := $(shell echo NMAP_VERSION | $(CPP) -imacros $(NMAPDIR)/nmap.h - | sed -n '$$s/[" ]//g;$$p')
export NMAP_VERSION := $(shell echo NMAP_NUM_VERSION | $(CPP) -imacros $(NMAPDIR)/nmap.h - | sed -n '$$s/[" ]//g;$$p')
export NPCAP_VERSION := $(shell ls npcap-*.exe | sed -e 's/npcap-\([0-9.]*\)[-oem]*\.exe/\1/' -e 'q')
COMMA_VERSION=$(shell echo $(NMAP_NUM_VERSION) | tr '.' ',')
LOGLOC=c:nmapbuild.log

15
nmap.h
View File

@@ -118,11 +118,20 @@
#endif
#define NMAP_URL "https://nmap.org"
#define _STR(X) #X
#define STR(X) _STR(X)
#ifndef NMAP_VERSION
/* Edit this definition only within the quotes, because it is read from this
file by the makefiles. */
#define NMAP_VERSION "7.91SVN"
#define NMAP_NUM_VERSION "7.91.1.0"
#define NMAP_MAJOR 7
#define NMAP_MINOR 91
#define NMAP_BUILD 1
/* SVN, BETA, etc. */
#define NMAP_SPECIAL "SVN"
#define NMAP_VERSION STR(NMAP_MAJOR) "." STR(NMAP_MINOR) NMAP_SPECIAL
#define NMAP_NUM_VERSION STR(NMAP_MAJOR) "." STR(NMAP_MINOR) "." STR(NMAP_BUILD) ".0"
#endif
#define NMAP_XMLOUTPUTVERSION "1.05"
@@ -136,8 +145,6 @@
#define MAX_TIMEOUTS MAX_SOCKETS /* How many timed out connection attempts
in a row before we decide the host is
dead? */
#define _STR(X) #X
#define STR(X) _STR(X)
#define DEFAULT_TCP_PROBE_PORT 80 /* The ports TCP ping probes go to if
unspecified by user -- uber hackers
change this to 113 */