dc2176950f
* mar moved and checked
158 lines
2.8 KiB
Makefile
Executable File
158 lines
2.8 KiB
Makefile
Executable File
#!/bin/sh
|
|
|
|
cat << EOF > Makefile
|
|
# Default target
|
|
.DEFAULT_GOAL = all
|
|
|
|
SHELL = $SHELL
|
|
CC = $CC
|
|
BISON = $BISON
|
|
FLEX = $FLEX
|
|
RM = $RM
|
|
RMDIR = $RMDIR
|
|
TEST = $TEST
|
|
MAKE = $MAKE
|
|
GREP = $GREP
|
|
CUT = $CUT
|
|
SORT = $SORT
|
|
PR = $PR
|
|
CP = $CP
|
|
CHMOD = $CHMOD
|
|
|
|
CFLAGS = $CFLAGS
|
|
LDFLAGS = $LDFLAGS
|
|
LDLIBS = $LDLIBS
|
|
BFLAGS = $BFLAGS
|
|
FFLAGS = $FFLAGS
|
|
|
|
DESTDIR = $DESTDIR
|
|
|
|
prefix = $prefix
|
|
exec_prefix = $exec_prefix
|
|
bindir = $bindir
|
|
sbindir = $sbindir
|
|
datarootdir = $datarootdir
|
|
datadir = $datadir
|
|
sysconfdir = $sysconfdir
|
|
sharedstatedir = $sharestatedir
|
|
localstatedir = $localstatedir
|
|
|
|
ALL_CFLAGS = \$(CFLAGS)
|
|
ALL_LDFLAGS = \$(LDFLAGS)
|
|
ALL_LDLIBS = \$(LDLIBS)
|
|
ALL_BFLAGS = \$(BFLAGS)
|
|
ALL_FFLAGS = -t \$(FFLAGS)
|
|
|
|
VPATH = ./src
|
|
|
|
PROGRAMS = tok sen fla gph kot unfla grp mar
|
|
|
|
TOK_OBJ_FILES = tok.o tok_cmdline.o
|
|
TOK_FLEX_FILES = tok.l
|
|
TOK_GGO_FILES = tok_cmdline.ggo
|
|
tok: \$(TOK_OBJ_FILES)
|
|
tok.o: tok.c
|
|
tok.o: tok_cmdline.h
|
|
tok.c: tok.l
|
|
tok_cmdline.o: tok_cmdline.c tok_cmdline.h
|
|
tok_cmdline.c: tok_cmdline.ggo
|
|
tok_cmdline.h: tok_cmdline.ggo
|
|
|
|
SEN_OBJ_FILES = sen.o
|
|
SEN_FLEX_FILES = sen.l
|
|
sen: \$(SEN_OBJ_FILES)
|
|
sen.o: sen.c
|
|
sen.c: sen.l
|
|
|
|
FLA_OBJ_FILES = fla.o
|
|
fla: \$(FLA_OBJ_FILES)
|
|
fla.o: fla.c
|
|
|
|
GPH_PERL_FILES = gph.pl
|
|
gph: \$(GPH_PERL_FILES)
|
|
|
|
KOT_PERL_FILES = kot.pl
|
|
kot: \$(KOT_PERL_FILES)
|
|
|
|
UNFLA_SH_FILES = unfla.sh
|
|
unfla: \$(UNFLA_SH_FILES)
|
|
|
|
GRP_PERL_FILES = grp.pl
|
|
grp: \$(GRP_PERL_FILES)
|
|
|
|
MAR_PERL_FILES = mar.pl
|
|
mar: \$(MAR_PERL_FILES)
|
|
|
|
CONFIG_FILES = src/config.h Makefile
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .l .y .h .c .pl .o
|
|
|
|
#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
|
|
#.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
|
|
#.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
|
|
#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
|
|
|
|
.PHONY: all
|
|
all: \$(PROGRAMS)
|
|
|
|
|
|
.PHONY: help
|
|
help:
|
|
@\$(MAKE) --print-data-base --question | \\
|
|
\$(GREP) '^[^.%][-A-Za-z0-9_]*:' | \\
|
|
\$(CUT) -f 1 -d : | \\
|
|
\$(GREP) -v '^Makefile$$' | \\
|
|
\$(SORT) | \\
|
|
\$(PR) --omit-pagination --width=80 --columns=4
|
|
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
\$(RM) \$(PROGRAMS)
|
|
\$(RM) \$(TOK_OBJ_FILES)
|
|
\$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
|
|
\$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
|
|
\$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
|
|
\$(RM) \$(SEN_OBJ_FILES)
|
|
\$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
|
|
\$(RM) \$(FLA_OBJ_FILES)
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
\$(RM) \$(CONFIG_FILES)
|
|
|
|
.PHONY: install
|
|
install: all
|
|
echo TODO: make install
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
echo TODO: make uninstall
|
|
|
|
%.o: %.c
|
|
\$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
|
|
|
|
%.c: %.l
|
|
\$(FLEX) -t \$< > \$@
|
|
|
|
%.c: %.ggo
|
|
gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
|
|
|
|
%.h: %.ggo
|
|
gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
|
|
|
|
%: %.o
|
|
\$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
|
|
|
|
%: %.pl
|
|
\$(CP) \$< \$@
|
|
\$(CHMOD) a+x \$@
|
|
|
|
%: %.sh
|
|
\$(CP) \$< \$@
|
|
\$(CHMOD) a+x \$@
|
|
|
|
EOF
|
|
|