[Client] Print version info with -V
This commit is contained in:
parent
7123f02e82
commit
82d1041ab2
|
@ -1,3 +1,8 @@
|
||||||
|
# Source version
|
||||||
|
ifndef OWLPS_VERSION
|
||||||
|
OWLPS_VERSION = $$(git describe || echo 'UNKNOWN_VERSION')
|
||||||
|
endif
|
||||||
|
|
||||||
# Répertoire d'installation
|
# Répertoire d'installation
|
||||||
PREFIX=/usr/local
|
PREFIX=/usr/local
|
||||||
INSTALL_DIR= $(PREFIX)/bin
|
INSTALL_DIR= $(PREFIX)/bin
|
||||||
|
@ -27,6 +32,7 @@ CFLAGS = -O2 -Wall -Wextra -Wstrict-prototypes \
|
||||||
DEPFLAGS = -MMD
|
DEPFLAGS = -MMD
|
||||||
XCFLAGS = $(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
|
XCFLAGS = $(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS)
|
||||||
PICFLAG = -fPIC
|
PICFLAG = -fPIC
|
||||||
|
OWLPSFLAGS = -D OWLPS_VERSION=\"$(OWLPS_VERSION)\"
|
||||||
LIBS = -L$(LIBOWLPS_DIR) -lowlps -L$(LIBOWLPSCLIENT_DIR) -lowlps-client
|
LIBS = -L$(LIBOWLPS_DIR) -lowlps -L$(LIBOWLPSCLIENT_DIR) -lowlps-client
|
||||||
STATIC_LIBS = -liw -lm -lrt
|
STATIC_LIBS = -liw -lm -lrt
|
||||||
|
|
||||||
|
@ -42,7 +48,7 @@ all : dynamic static
|
||||||
% : %.o
|
% : %.o
|
||||||
$(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS)
|
$(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS)
|
||||||
%.o : %.c $(HEADER)
|
%.o : %.c $(HEADER)
|
||||||
$(CC) $(XCFLAGS) -c $<
|
$(CC) $(XCFLAGS) $(OWLPSFLAGS) -c $<
|
||||||
|
|
||||||
# Compilation du programme
|
# Compilation du programme
|
||||||
$(TARGET) : $(TARGET).o $(HEADER)
|
$(TARGET) : $(TARGET).o $(HEADER)
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
# Source version
|
||||||
|
ifndef OWLPS_VERSION
|
||||||
|
OWLPS_VERSION = $$(git describe || echo 'UNKNOWN_VERSION')
|
||||||
|
endif
|
||||||
|
|
||||||
# Emplacement de la suite de cross-compilation
|
# Emplacement de la suite de cross-compilation
|
||||||
TOOLCHAIN_PREFIX = $$HOME/openwrt/atheros/8.09
|
TOOLCHAIN_PREFIX = $$HOME/openwrt/atheros/8.09
|
||||||
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/staging_dir/toolchain-mips_gcc4.1.2/bin
|
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/staging_dir/toolchain-mips_gcc4.1.2/bin
|
||||||
|
@ -40,6 +45,7 @@ STATIC_LIBS = $(LOWLPSA) $(LIBS)
|
||||||
LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib
|
LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib
|
||||||
IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include
|
IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include
|
||||||
LDFLAGS = $(IATHEROS) $(LATHEROS)
|
LDFLAGS = $(IATHEROS) $(LATHEROS)
|
||||||
|
OWLPSFLAGS = -D OWLPS_VERSION=\"$(OWLPS_VERSION)\"
|
||||||
|
|
||||||
|
|
||||||
## Cibles de compilation standard ##
|
## Cibles de compilation standard ##
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
# Source version
|
||||||
|
ifndef OWLPS_VERSION
|
||||||
|
OWLPS_VERSION = $$(git describe || echo 'UNKNOWN_VERSION')
|
||||||
|
endif
|
||||||
|
|
||||||
# Emplacement de la suite de cross-compilation
|
# Emplacement de la suite de cross-compilation
|
||||||
TOOLCHAIN_PREFIX = $$HOME/openwrt/atheros/10.03
|
TOOLCHAIN_PREFIX = $$HOME/openwrt/atheros/10.03
|
||||||
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin
|
TOOLCHAIN_BIN = $(TOOLCHAIN_PREFIX)/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin
|
||||||
|
@ -40,6 +45,7 @@ STATIC_LIBS = $(LOWLPSA) $(LIBS)
|
||||||
LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib
|
LATHEROS = -L$(TOOLCHAIN_USR)/lib -L$(TOOLCHAIN_USR_2)/lib
|
||||||
IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include
|
IATHEROS = -I$(TOOLCHAIN_USR)/include -I$(TOOLCHAIN_USR_2)/include
|
||||||
LDFLAGS = $(IATHEROS) $(LATHEROS)
|
LDFLAGS = $(IATHEROS) $(LATHEROS)
|
||||||
|
OWLPSFLAGS = -D OWLPS_VERSION=\"$(OWLPS_VERSION)\"
|
||||||
|
|
||||||
|
|
||||||
## Cibles de compilation standard ##
|
## Cibles de compilation standard ##
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define DEFAULT_DELAY_NORMAL 25000 // Localisation request
|
#define DEFAULT_DELAY_NORMAL 25000 // Localisation request
|
||||||
|
|
||||||
/* Program arguments (getopt string) */
|
/* Program arguments (getopt string) */
|
||||||
#define OPTIONS "d:hi:l::n:p:t:"
|
#define OPTIONS "d:hi:l::n:p:t:V"
|
||||||
|
|
||||||
|
|
||||||
/* Function headers */
|
/* Function headers */
|
||||||
|
@ -43,6 +43,7 @@ void make_packet(void) ;
|
||||||
void send_request(void) ;
|
void send_request(void) ;
|
||||||
void receive_position(void) ;
|
void receive_position(void) ;
|
||||||
void print_usage(void) ;
|
void print_usage(void) ;
|
||||||
|
void print_version(void) ;
|
||||||
|
|
||||||
|
|
||||||
/* Options */
|
/* Options */
|
||||||
|
@ -162,6 +163,9 @@ void parse_main_options(int argc, char **argv)
|
||||||
case 't' :
|
case 't' :
|
||||||
options.delay = strtol(optarg, NULL, 0) ;
|
options.delay = strtol(optarg, NULL, 0) ;
|
||||||
break ;
|
break ;
|
||||||
|
case 'V' :
|
||||||
|
print_version() ;
|
||||||
|
exit(0) ;
|
||||||
default :
|
default :
|
||||||
print_usage() ;
|
print_usage() ;
|
||||||
exit(ERR_BAD_USAGE) ;
|
exit(ERR_BAD_USAGE) ;
|
||||||
|
@ -408,6 +412,7 @@ void print_usage()
|
||||||
"\n"
|
"\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
"\t-h\t\tPrint this help.\n"
|
"\t-h\t\tPrint this help.\n"
|
||||||
|
"\t-V\t\tPrint version information.\n"
|
||||||
"\t-d dest_ip\tDestination IP address of the localisation request.\n"
|
"\t-d dest_ip\tDestination IP address of the localisation request.\n"
|
||||||
"\t-p dest_port\tDestination port of the localisation request"
|
"\t-p dest_port\tDestination port of the localisation request"
|
||||||
" (default: %d).\n"
|
" (default: %d).\n"
|
||||||
|
@ -434,3 +439,17 @@ void print_usage()
|
||||||
MOBILE_DEFAULT_PORT
|
MOBILE_DEFAULT_PORT
|
||||||
) ;
|
) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void print_version()
|
||||||
|
{
|
||||||
|
printf("This is OwlPS Client, part of the Open Wireless"
|
||||||
|
" Positioning System project.\n"
|
||||||
|
"Version: %s.\n",
|
||||||
|
#ifdef OWLPS_VERSION
|
||||||
|
OWLPS_VERSION
|
||||||
|
#else // OWLPS_VERSION
|
||||||
|
"unknown version"
|
||||||
|
#endif // OWLPS_VERSION
|
||||||
|
) ;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue