Migration to new build system. All tools need to be moved to ./src

directory and checked whether can be compiled by Makefile.
 * tok moved and checked
This commit is contained in:
Mateusz Hromada 2009-06-07 01:25:24 +02:00
parent 44f59b8b51
commit 12743b9e8c
4 changed files with 23 additions and 28 deletions

View File

@ -1,21 +0,0 @@
PAR=-O3 -m32
#-static
tok: tok.c cmdline.c
cc $(PAR) tok.c cmdline.c -o tok
tok.c: tok.l
flex -8 -f -otok.c tok.l
cmdline.c cmdline.h: cmdline_tok.ggo
gengetopt -i cmdline_tok.ggo --conf-parser
clean:
rm *.c
rm cmdline.*
rm tok
copy: tok
ifdef UTT_BIN_DIR
cp tok ${UTT_BIN_DIR}
endif

View File

@ -2,7 +2,7 @@
cat << EOF > Makefile
# Default target
.DEFAULT: all
.DEFAULT_GOAL = all
SHELL = $SHELL
CC = $CC
@ -43,16 +43,24 @@ ALL_FFLAGS = -t \$(FFLAGS)
VPATH = ./src
PROGRAMS = tok
TOK_OBJ_FILES = tok.o tok_cmdline.o
TOK_FLEX_FILES = tok.l
TOK_GGO_FILES = tok_cmdline.ggo
tok.o: tok_cmdline.h
CONFIG_FILES = src/config.h Makefile
.SUFFIXES:
.SUFFIXES: .l .y .h .c .o
.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
.PHONY: all
all: \$(PROGRAMS)
#make -C app compile
.PHONY: help
help:
@ -69,7 +77,8 @@ clean:
\$(RM) \$(PROGRAMS)
\$(RM) \$(TOK_OBJ_FILES)
\$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
#make -C app clean
\$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
\$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
.PHONY: distclean
distclean: clean
@ -86,9 +95,15 @@ uninstall:
%.o: %.c
\$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
%.o: %.l
%.c: %.l
\$(FLEX) -t \$< > \$@
%.c: %.ggo
gengetopt --input $< --file-name \$(patsubst %.c,%,\$@) --conf-parser
%.h: %.ggo
gengetopt --input $< --file-name \$(patsubst %.h,%,\$@) --conf-parser
%: %.o
\$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)

View File

@ -1,7 +1,7 @@
%{
#include <stdio.h>
#include <locale.h>
#include "cmdline.h"
#include "tok_cmdline.h"
int filepos=0;
@ -55,12 +55,13 @@
%%
main(int argc, char** argv)
int main(int argc, char** argv)
{
if (cmdline_parser(argc, argv, &args) != 0) exit(1);
if (cmdline_parser(argc, argv, &args) != 0) return 1;
setlocale(LC_CTYPE,"");
setlocale(LC_COLLATE,"");
yylex();
return 0;
}
int yywrap()