Commit 8e45b106 authored by chenhaowen's avatar chenhaowen

fix: marco VERSION

parent f1f9fbbe
#CC:=gcc #CC:=gcc
VERSION:=1.6.7 VERSION:=1.6.7
CFLAGS+= -Wall -fPIC -DDEBUG -DVERSION=\"$(VERSION)\" CFLAGS+= -Wall -fPIC -DDEBUG -DVERSION=$(VERSION)
objects= config.o auth.o objects= config.o auth.o
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#include <unistd.h> #include <unistd.h>
#include <getopt.h> #include <getopt.h>
#ifndef VERSION
#define VERSION 0.0.0
#endif
struct option_s { struct option_s {
char key[256]; char key[256];
char value[256]; char value[256];
...@@ -42,7 +46,7 @@ void set_enable_crypt(int enable) ...@@ -42,7 +46,7 @@ void set_enable_crypt(int enable)
void get_version(char* version) void get_version(char* version)
{ {
strcpy(version, VERSION); strcpy(version, "VERSION");
} }
void set_log_file(char * log_file, int len) void set_log_file(char * log_file, int len)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "config.h" #include "config.h"
#ifndef VERSION #ifndef VERSION
#define VERSION "unkown" #define VERSION 0.0.0
#endif #endif
static void print_help(char * name); static void print_help(char * name);
...@@ -67,7 +67,7 @@ int main(int argc, char *argv[]) ...@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
exit(0); exit(0);
break; break;
case 'v': case 'v':
fprintf(stdout, "version: %s\n", VERSION); fprintf(stdout, "version: %s\n", "VERSION");
exit(0); exit(0);
break; break;
case 'l': case 'l':
...@@ -107,7 +107,7 @@ static void print_help(char *name) ...@@ -107,7 +107,7 @@ static void print_help(char *name)
" /___/ " " /___/ "
); );
fprintf(stdout, "A third-party drcom client for gdut. version %s\n", VERSION); fprintf(stdout, "A third-party drcom client for gdut. version %s\n", "VERSION");
fprintf(stdout, "usage:\n"); fprintf(stdout, "usage:\n");
fprintf(stdout, " %s\n", name); fprintf(stdout, " %s\n", name);
fprintf(stdout, " --remote-ip <ip addr> The server ip.\n"); fprintf(stdout, " --remote-ip <ip addr> The server ip.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment