[c08f3b1] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | cat << EOF > Makefile |
---|
| 4 | # Default target |
---|
[12743b9] | 5 | .DEFAULT_GOAL = all |
---|
[c08f3b1] | 6 | |
---|
| 7 | SHELL = $SHELL |
---|
| 8 | CC = $CC |
---|
| 9 | BISON = $BISON |
---|
[44f59b8] | 10 | FLEX = $FLEX |
---|
[c08f3b1] | 11 | RM = $RM |
---|
| 12 | RMDIR = $RMDIR |
---|
| 13 | TEST = $TEST |
---|
| 14 | MAKE = $MAKE |
---|
| 15 | GREP = $GREP |
---|
| 16 | CUT = $CUT |
---|
| 17 | SORT = $SORT |
---|
| 18 | PR = $PR |
---|
[e4cec26] | 19 | CP = $CP |
---|
| 20 | CHMOD = $CHMOD |
---|
[9a36761] | 21 | MAKEINFO = $MAKEINFO |
---|
| 22 | TEXI2DVI = $TEXI2DVI |
---|
| 23 | TEXI2PDF = $TEXI2PDF |
---|
| 24 | DVIPS = $DVIPS |
---|
[c08f3b1] | 25 | |
---|
| 26 | CFLAGS = $CFLAGS |
---|
| 27 | LDFLAGS = $LDFLAGS |
---|
| 28 | LDLIBS = $LDLIBS |
---|
| 29 | BFLAGS = $BFLAGS |
---|
[e4cec26] | 30 | FFLAGS = $FFLAGS |
---|
[c08f3b1] | 31 | |
---|
| 32 | DESTDIR = $DESTDIR |
---|
| 33 | |
---|
| 34 | prefix = $prefix |
---|
| 35 | exec_prefix = $exec_prefix |
---|
| 36 | bindir = $bindir |
---|
| 37 | sbindir = $sbindir |
---|
| 38 | datarootdir = $datarootdir |
---|
| 39 | datadir = $datadir |
---|
| 40 | sysconfdir = $sysconfdir |
---|
| 41 | sharedstatedir = $sharestatedir |
---|
| 42 | localstatedir = $localstatedir |
---|
| 43 | |
---|
| 44 | ALL_CFLAGS = \$(CFLAGS) |
---|
| 45 | ALL_LDFLAGS = \$(LDFLAGS) |
---|
| 46 | ALL_LDLIBS = \$(LDLIBS) |
---|
| 47 | ALL_BFLAGS = \$(BFLAGS) |
---|
[44f59b8] | 48 | ALL_FFLAGS = -t \$(FFLAGS) |
---|
[c08f3b1] | 49 | |
---|
[9a36761] | 50 | vpath %.c ./src |
---|
| 51 | vpath %.l ./src |
---|
| 52 | vpath %.pl ./src |
---|
| 53 | vpath %.sed ./src |
---|
| 54 | vpath %.sh ./src |
---|
| 55 | vpath %.texinfo ./doc |
---|
[c08f3b1] | 56 | |
---|
[b5884b3] | 57 | PROGRAMS = tok sen fla gph kot unfla grp mar ser kon rm12 rs12 |
---|
[9a36761] | 58 | DOC_FILES = utt.info utt.dvi utt.html utt.pdf utt.ps |
---|
[12743b9] | 59 | |
---|
[44f59b8] | 60 | TOK_OBJ_FILES = tok.o tok_cmdline.o |
---|
| 61 | TOK_FLEX_FILES = tok.l |
---|
[12743b9] | 62 | TOK_GGO_FILES = tok_cmdline.ggo |
---|
[3a2ae91] | 63 | tok: \$(TOK_OBJ_FILES) |
---|
| 64 | tok.o: tok.c |
---|
[12743b9] | 65 | tok.o: tok_cmdline.h |
---|
[3a2ae91] | 66 | tok.c: tok.l |
---|
| 67 | tok_cmdline.o: tok_cmdline.c tok_cmdline.h |
---|
| 68 | tok_cmdline.c: tok_cmdline.ggo |
---|
| 69 | tok_cmdline.h: tok_cmdline.ggo |
---|
[12743b9] | 70 | |
---|
[1e551bd] | 71 | SEN_OBJ_FILES = sen.o |
---|
| 72 | SEN_FLEX_FILES = sen.l |
---|
[3a2ae91] | 73 | sen: \$(SEN_OBJ_FILES) |
---|
| 74 | sen.o: sen.c |
---|
| 75 | sen.c: sen.l |
---|
[1e551bd] | 76 | |
---|
[9e0afb5] | 77 | FLA_OBJ_FILES = fla.o |
---|
[3a2ae91] | 78 | fla: \$(FLA_OBJ_FILES) |
---|
| 79 | fla.o: fla.c |
---|
[9e0afb5] | 80 | |
---|
[e4cec26] | 81 | GPH_PERL_FILES = gph.pl |
---|
[3a2ae91] | 82 | gph: \$(GPH_PERL_FILES) |
---|
| 83 | |
---|
| 84 | KOT_PERL_FILES = kot.pl |
---|
| 85 | kot: \$(KOT_PERL_FILES) |
---|
[e4cec26] | 86 | |
---|
[1e572e1] | 87 | UNFLA_SH_FILES = unfla.sh |
---|
| 88 | unfla: \$(UNFLA_SH_FILES) |
---|
| 89 | |
---|
[ac9a049] | 90 | GRP_PERL_FILES = grp.pl |
---|
| 91 | grp: \$(GRP_PERL_FILES) |
---|
| 92 | |
---|
[dc21769] | 93 | MAR_PERL_FILES = mar.pl |
---|
| 94 | mar: \$(MAR_PERL_FILES) |
---|
| 95 | |
---|
[8c8a252] | 96 | SER_PERL_FILES = ser.pl |
---|
| 97 | ser: \$(SER_PERL_FILES) |
---|
| 98 | |
---|
[8e1730c] | 99 | KON_PERL_FILES = kon.pl |
---|
| 100 | kon: \$(KON_PERL_FILES) |
---|
| 101 | |
---|
[4518a0b] | 102 | RM12_SED_FILES = rm12.sed |
---|
| 103 | rm12: \$(RM12_SED_FILES) |
---|
| 104 | |
---|
[b5884b3] | 105 | RS12_OBJ_FILES = rs12.o |
---|
| 106 | rs12: \$(RS12_OBJ_FILES) |
---|
| 107 | rs12.o: rs12.c |
---|
| 108 | |
---|
[c08f3b1] | 109 | CONFIG_FILES = src/config.h Makefile |
---|
| 110 | |
---|
| 111 | .SUFFIXES: |
---|
[3a2ae91] | 112 | .SUFFIXES: .l .y .h .c .pl .o |
---|
[c08f3b1] | 113 | |
---|
| 114 | .PHONY: help |
---|
| 115 | help: |
---|
| 116 | @\$(MAKE) --print-data-base --question | \\ |
---|
| 117 | \$(GREP) '^[^.%][-A-Za-z0-9_]*:' | \\ |
---|
| 118 | \$(CUT) -f 1 -d : | \\ |
---|
| 119 | \$(GREP) -v '^Makefile$$' | \\ |
---|
| 120 | \$(SORT) | \\ |
---|
| 121 | \$(PR) --omit-pagination --width=80 --columns=4 |
---|
| 122 | |
---|
[9a36761] | 123 | .PHONY: all |
---|
| 124 | all: \$(PROGRAMS) |
---|
| 125 | |
---|
| 126 | .PHONY: install |
---|
| 127 | install: all |
---|
| 128 | |
---|
| 129 | .PHONY: install-strip |
---|
| 130 | install: |
---|
| 131 | |
---|
| 132 | .PHONY: info |
---|
| 133 | info: utt.info |
---|
| 134 | |
---|
| 135 | .PHONY: install-info |
---|
| 136 | install-info: |
---|
| 137 | |
---|
| 138 | .PHONY: dvi |
---|
| 139 | dvi: utt.dvi |
---|
| 140 | |
---|
| 141 | .PHONY: install-dvi |
---|
| 142 | install-dvi: |
---|
| 143 | |
---|
| 144 | .PHONY: html |
---|
| 145 | html: utt.html |
---|
| 146 | |
---|
| 147 | .PHONY: install-html |
---|
| 148 | install-html: |
---|
| 149 | |
---|
| 150 | .PHONY: pdf |
---|
| 151 | pdf: utt.pdf |
---|
| 152 | |
---|
| 153 | .PHONY: install-pdf |
---|
| 154 | install-pdf: |
---|
| 155 | |
---|
| 156 | .PHONY: ps |
---|
| 157 | ps: utt.ps |
---|
| 158 | |
---|
| 159 | .PHONY: install-ps |
---|
| 160 | install-ps: |
---|
| 161 | |
---|
| 162 | .PHONY: uninstall |
---|
| 163 | uninstall: |
---|
[c08f3b1] | 164 | |
---|
| 165 | .PHONY: clean |
---|
| 166 | clean: |
---|
| 167 | \$(RM) \$(PROGRAMS) |
---|
| 168 | \$(RM) \$(TOK_OBJ_FILES) |
---|
[44f59b8] | 169 | \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES)) |
---|
[12743b9] | 170 | \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES)) |
---|
| 171 | \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES)) |
---|
[3a2ae91] | 172 | \$(RM) \$(SEN_OBJ_FILES) |
---|
[1e551bd] | 173 | \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES)) |
---|
[3a2ae91] | 174 | \$(RM) \$(FLA_OBJ_FILES) |
---|
[b5884b3] | 175 | \$(RM) \$(RS12_OBJ_FILES) |
---|
[9a36761] | 176 | \$(RM) \$(DOC_FILES) |
---|
[c08f3b1] | 177 | |
---|
| 178 | .PHONY: distclean |
---|
| 179 | distclean: clean |
---|
| 180 | \$(RM) \$(CONFIG_FILES) |
---|
| 181 | |
---|
| 182 | %.o: %.c |
---|
| 183 | \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS) |
---|
| 184 | |
---|
[12743b9] | 185 | %.c: %.l |
---|
[44f59b8] | 186 | \$(FLEX) -t \$< > \$@ |
---|
| 187 | |
---|
[12743b9] | 188 | %.c: %.ggo |
---|
[e4cec26] | 189 | gengetopt --input \$< --file-name \$(basename \$@) --conf-parser |
---|
[12743b9] | 190 | |
---|
| 191 | %.h: %.ggo |
---|
[e4cec26] | 192 | gengetopt --input \$< --file-name \$(basename \$@) --conf-parser |
---|
[12743b9] | 193 | |
---|
[c08f3b1] | 194 | %: %.o |
---|
| 195 | \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS) |
---|
| 196 | |
---|
[e4cec26] | 197 | %: %.pl |
---|
| 198 | \$(CP) \$< \$@ |
---|
| 199 | \$(CHMOD) a+x \$@ |
---|
| 200 | |
---|
[1e572e1] | 201 | %: %.sh |
---|
| 202 | \$(CP) \$< \$@ |
---|
| 203 | \$(CHMOD) a+x \$@ |
---|
| 204 | |
---|
[4518a0b] | 205 | %: %.sed |
---|
| 206 | \$(CP) \$< \$@ |
---|
| 207 | \$(CHMOD) a+x \$@ |
---|
| 208 | |
---|
[9a36761] | 209 | %.info: %.texinfo |
---|
| 210 | \$(MAKEINFO) \$< -o \$@ |
---|
| 211 | |
---|
| 212 | %.dvi: %.texinfo |
---|
| 213 | \$(TEXI2DVI) --build=clean \$< -o \$@ |
---|
| 214 | |
---|
| 215 | %.html: %.texinfo |
---|
| 216 | \$(MAKEINFO) --html --no-split \$< -o \$@ |
---|
| 217 | |
---|
| 218 | %.pdf: %.texinfo |
---|
| 219 | \$(TEXI2PDF) --build=clean \$< -o \$@ |
---|
| 220 | |
---|
| 221 | %.ps: %.dvi |
---|
| 222 | \$(DVIPS) \$< -o \$@ |
---|
| 223 | |
---|
[c08f3b1] | 224 | EOF |
---|
| 225 | |
---|