tcledit/libwld: Add support for building debug versions.
This commit is contained in:
parent
c79f1deb2b
commit
8404acae22
@ -60,7 +60,7 @@ OBJS = $(SRCS:.c=.o)
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
AR = ar -rcv
|
AR = ar -rcv
|
||||||
|
|
||||||
DEBUG_LEVEL = 0
|
DEBUG_LEVEL ?= 0
|
||||||
DEFINES = -DDEBUG_LEVEL=$(DEBUG_LEVEL)
|
DEFINES = -DDEBUG_LEVEL=$(DEBUG_LEVEL)
|
||||||
INCLUDES = -I. -I$(APPDIR)/include -I$(TRAVELER)/include -isystem $(NUTTXDIR)
|
INCLUDES = -I. -I$(APPDIR)/include -I$(TRAVELER)/include -isystem $(NUTTXDIR)
|
||||||
WARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wno-trigraphs
|
WARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wno-trigraphs
|
||||||
|
@ -20,4 +20,9 @@ Build instuctions:
|
|||||||
Then you can build the world library:
|
Then you can build the world library:
|
||||||
|
|
||||||
5. cd apps/graphics/traveler/tools/libwld
|
5. cd apps/graphics/traveler/tools/libwld
|
||||||
6. make
|
6a. make
|
||||||
|
|
||||||
|
If you want to create a debug-able version of the library, do:
|
||||||
|
|
||||||
|
6b. make DEBUG_LEVEL=1
|
||||||
|
|
||||||
|
@ -21,7 +21,11 @@ Build instuctions
|
|||||||
Build the world library:
|
Build the world library:
|
||||||
|
|
||||||
5. cd apps/graphics/traveler/tools/libwld
|
5. cd apps/graphics/traveler/tools/libwld
|
||||||
6. make
|
6a. make
|
||||||
|
|
||||||
|
If you want to create a debug-able version of the library, do:
|
||||||
|
|
||||||
|
6b. make DEBUG_LEVEL=1
|
||||||
|
|
||||||
Then you can use xmfmk to create the Makefile and build the tool:
|
Then you can use xmfmk to create the Makefile and build the tool:
|
||||||
|
|
||||||
@ -30,19 +34,23 @@ Build instuctions
|
|||||||
a minimum. These are the paths to where you have clones the apps/ repository
|
a minimum. These are the paths to where you have clones the apps/ repository
|
||||||
and the nuttx/ repositories, respectively.
|
and the nuttx/ repositories, respectively.
|
||||||
9. xmfmk
|
9. xmfmk
|
||||||
10. make tcledit
|
10a. make tcledit
|
||||||
|
|
||||||
|
If you want to create a debug-able version of tcledit, do:
|
||||||
|
|
||||||
|
10b. make tcledit DEBUG_LEVEL=1
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
. /tcledit [-o <outfilename>] <infilename>
|
. /tcledit [-D <directory>] [-o <outfilename>] <infilename>
|
||||||
|
|
||||||
Where <infilename> is the original world file name which will be overwritten
|
Where <infilename> is the original world file name which will be overwritten
|
||||||
unless <outfilename> is provided.
|
unless <outfilename> is provided. Optionally, switch to <directory> before
|
||||||
|
opening <infilenamea>.
|
||||||
|
|
||||||
NOTE: The default traveler world file is apps/graphics/traverler/world/transfrm.wld.
|
NOTE: The default traveler world file is apps/graphics/traverler/world/transfrm.wld.
|
||||||
The file contains relative paths so you may have to CD in to the directory first
|
The file contains relative paths so you may have to CD in to the directory first
|
||||||
like:
|
like:
|
||||||
|
|
||||||
cd world
|
./tcledit -D ../../world transfrm.wld
|
||||||
../tools/tcledit/tcledit transfrm.wld
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <tk.h>
|
#include <tk.h>
|
||||||
|
|
||||||
#include "trv_types.h"
|
#include "trv_types.h"
|
||||||
@ -593,7 +594,8 @@ static int tcledit_save_rectangles(ClientData clientData,
|
|||||||
|
|
||||||
static void show_usage(const char *progname)
|
static void show_usage(const char *progname)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "USAGE:\n\t%s [-o <outfilename>] <infilename>\n", progname);
|
fprintf(stderr, "USAGE:\n\t%s [-D <directory>] [-o <outfilename>] <infilename>\n",
|
||||||
|
progname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,19 +605,34 @@ static void show_usage(const char *progname)
|
|||||||
|
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
|
char *directory;
|
||||||
int option;
|
int option;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Parse command line options */
|
/* Parse command line options */
|
||||||
|
|
||||||
g_out_filename = g_default_filename;
|
g_out_filename = g_default_filename;
|
||||||
|
|
||||||
while ((option = getopt(argc, argv, "o:")) != EOF)
|
while ((option = getopt(argc, argv, "D:o:")) != EOF)
|
||||||
{
|
{
|
||||||
switch (option)
|
switch (option)
|
||||||
{
|
{
|
||||||
|
case 'D':
|
||||||
|
directory = optarg;
|
||||||
|
ret = chdir(directory);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
int errcode = errno;
|
||||||
|
fprintf(stderr, "ERROR: Failed to CD to %s: %s\n",
|
||||||
|
directory, strerror(errcode));
|
||||||
|
show_usage(argv[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'o':
|
case 'o':
|
||||||
g_out_filename = optarg;
|
g_out_filename = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unrecognized option: %c\n", option);
|
fprintf(stderr, "Unrecognized option: %c\n", option);
|
||||||
show_usage(argv[0]);
|
show_usage(argv[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user