[c08f3b1] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | cat << EOF > Makefile |
---|
| 4 | # Default target |
---|
[12743b9] | 5 | .DEFAULT_GOAL = all |
---|
[c08f3b1] | 6 | |
---|
[c7ecbc2] | 7 | PROJECT_NAME = $PROJECT_NAME |
---|
| 8 | PROJECT_FULLNAME = $PROJECT_FULLNAME |
---|
| 9 | PROJECT_COPYRIGHT = $PROJECT_COPYRIGHT |
---|
| 10 | PROJECT_VERSION = $PROJECT_VERSION |
---|
| 11 | PROEJCT_PAGE = $PROJECT_PAGE |
---|
| 12 | PROJECT_MAIL = $PROJECT_MAIL |
---|
| 13 | |
---|
| 14 | INSTALL = $INSTALL |
---|
| 15 | INSTALL_PROGRAM = \$(INSTALL) |
---|
| 16 | INSTALL_PROGRAM_STRIP = \$(INSTALL) -s |
---|
| 17 | INSTALL_DATA = \$(INSTALL) -m 644 |
---|
| 18 | INSTALL_DIR = \$(INSTALL) -d |
---|
[c08f3b1] | 19 | SHELL = $SHELL |
---|
| 20 | CC = $CC |
---|
| 21 | BISON = $BISON |
---|
[44f59b8] | 22 | FLEX = $FLEX |
---|
[c08f3b1] | 23 | RM = $RM |
---|
| 24 | RMDIR = $RMDIR |
---|
| 25 | TEST = $TEST |
---|
| 26 | MAKE = $MAKE |
---|
| 27 | GREP = $GREP |
---|
| 28 | CUT = $CUT |
---|
| 29 | SORT = $SORT |
---|
| 30 | PR = $PR |
---|
[e4cec26] | 31 | CP = $CP |
---|
| 32 | CHMOD = $CHMOD |
---|
[9a36761] | 33 | MAKEINFO = $MAKEINFO |
---|
| 34 | TEXI2DVI = $TEXI2DVI |
---|
| 35 | TEXI2PDF = $TEXI2PDF |
---|
| 36 | DVIPS = $DVIPS |
---|
[c08f3b1] | 37 | |
---|
| 38 | CFLAGS = $CFLAGS |
---|
| 39 | LDFLAGS = $LDFLAGS |
---|
| 40 | LDLIBS = $LDLIBS |
---|
| 41 | BFLAGS = $BFLAGS |
---|
[e4cec26] | 42 | FFLAGS = $FFLAGS |
---|
[c08f3b1] | 43 | |
---|
| 44 | DESTDIR = $DESTDIR |
---|
| 45 | |
---|
| 46 | prefix = $prefix |
---|
| 47 | exec_prefix = $exec_prefix |
---|
| 48 | bindir = $bindir |
---|
| 49 | sbindir = $sbindir |
---|
[c7ecbc2] | 50 | libexecdir = $libexecdir |
---|
[c08f3b1] | 51 | datarootdir = $datarootdir |
---|
| 52 | datadir = $datadir |
---|
| 53 | sysconfdir = $sysconfdir |
---|
[c7ecbc2] | 54 | sharedstatedir = $sharedstatedir |
---|
[c08f3b1] | 55 | localstatedir = $localstatedir |
---|
[c7ecbc2] | 56 | docdir = $docdir |
---|
| 57 | infodir = $infodir |
---|
| 58 | htmldir = $htmldir |
---|
| 59 | dvidir = $dvidir |
---|
| 60 | pdfdir = $pdfdir |
---|
| 61 | psdir = $psdir |
---|
| 62 | libdir = $libdir |
---|
| 63 | localedir = $localedir |
---|
| 64 | mandir = $mandir |
---|
| 65 | man1dir = $man1dir |
---|
| 66 | man2dir = $man2dir |
---|
| 67 | man3dir = $man3dir |
---|
| 68 | man4dir = $man4dir |
---|
| 69 | man5dir = $man5dir |
---|
| 70 | man6dir = $man6dir |
---|
| 71 | man7dir = $man7dir |
---|
| 72 | man8dir = $man8dir |
---|
| 73 | man9dir = $man9dir |
---|
| 74 | manext = $manext |
---|
| 75 | man1ext = $man1ext |
---|
| 76 | man2ext = $man2ext |
---|
| 77 | man3ext = $man3ext |
---|
| 78 | man4ext = $man4ext |
---|
| 79 | man5ext = $man5ext |
---|
| 80 | man6ext = $man6ext |
---|
| 81 | man7ext = $man7ext |
---|
| 82 | man8ext = $man8ext |
---|
| 83 | man9ext = $man9ext |
---|
[c08f3b1] | 84 | |
---|
| 85 | ALL_CFLAGS = \$(CFLAGS) |
---|
| 86 | ALL_LDFLAGS = \$(LDFLAGS) |
---|
| 87 | ALL_LDLIBS = \$(LDLIBS) |
---|
| 88 | ALL_BFLAGS = \$(BFLAGS) |
---|
[44f59b8] | 89 | ALL_FFLAGS = -t \$(FFLAGS) |
---|
[c08f3b1] | 90 | |
---|
[9a36761] | 91 | vpath %.c ./src |
---|
| 92 | vpath %.l ./src |
---|
[c7ecbc2] | 93 | vpath %.ggo ./src |
---|
[9a36761] | 94 | vpath %.pl ./src |
---|
| 95 | vpath %.sed ./src |
---|
| 96 | vpath %.sh ./src |
---|
| 97 | vpath %.texinfo ./doc |
---|
[c08f3b1] | 98 | |
---|
[c7ecbc2] | 99 | PROGRAMS_SCRIPT = gph kot unfla grp mar ser kon rm12 |
---|
| 100 | PROGRAMS_EXEC = tok sen fla rs12 |
---|
| 101 | PROGRAMS = \$(PROGRAMS_SCRIPT) \$(PROGRAMS_EXEC) |
---|
[9a36761] | 102 | DOC_FILES = utt.info utt.dvi utt.html utt.pdf utt.ps |
---|
[12743b9] | 103 | |
---|
[44f59b8] | 104 | TOK_OBJ_FILES = tok.o tok_cmdline.o |
---|
| 105 | TOK_FLEX_FILES = tok.l |
---|
[12743b9] | 106 | TOK_GGO_FILES = tok_cmdline.ggo |
---|
[3a2ae91] | 107 | tok: \$(TOK_OBJ_FILES) |
---|
| 108 | tok.o: tok.c |
---|
[12743b9] | 109 | tok.o: tok_cmdline.h |
---|
[3a2ae91] | 110 | tok.c: tok.l |
---|
| 111 | tok_cmdline.o: tok_cmdline.c tok_cmdline.h |
---|
| 112 | tok_cmdline.c: tok_cmdline.ggo |
---|
| 113 | tok_cmdline.h: tok_cmdline.ggo |
---|
[12743b9] | 114 | |
---|
[1e551bd] | 115 | SEN_OBJ_FILES = sen.o |
---|
| 116 | SEN_FLEX_FILES = sen.l |
---|
[3a2ae91] | 117 | sen: \$(SEN_OBJ_FILES) |
---|
| 118 | sen.o: sen.c |
---|
| 119 | sen.c: sen.l |
---|
[1e551bd] | 120 | |
---|
[9e0afb5] | 121 | FLA_OBJ_FILES = fla.o |
---|
[3a2ae91] | 122 | fla: \$(FLA_OBJ_FILES) |
---|
| 123 | fla.o: fla.c |
---|
[9e0afb5] | 124 | |
---|
[e4cec26] | 125 | GPH_PERL_FILES = gph.pl |
---|
[3a2ae91] | 126 | gph: \$(GPH_PERL_FILES) |
---|
| 127 | |
---|
| 128 | KOT_PERL_FILES = kot.pl |
---|
| 129 | kot: \$(KOT_PERL_FILES) |
---|
[e4cec26] | 130 | |
---|
[1e572e1] | 131 | UNFLA_SH_FILES = unfla.sh |
---|
| 132 | unfla: \$(UNFLA_SH_FILES) |
---|
| 133 | |
---|
[ac9a049] | 134 | GRP_PERL_FILES = grp.pl |
---|
| 135 | grp: \$(GRP_PERL_FILES) |
---|
| 136 | |
---|
[dc21769] | 137 | MAR_PERL_FILES = mar.pl |
---|
| 138 | mar: \$(MAR_PERL_FILES) |
---|
| 139 | |
---|
[8c8a252] | 140 | SER_PERL_FILES = ser.pl |
---|
| 141 | ser: \$(SER_PERL_FILES) |
---|
| 142 | |
---|
[8e1730c] | 143 | KON_PERL_FILES = kon.pl |
---|
| 144 | kon: \$(KON_PERL_FILES) |
---|
| 145 | |
---|
[4518a0b] | 146 | RM12_SED_FILES = rm12.sed |
---|
| 147 | rm12: \$(RM12_SED_FILES) |
---|
| 148 | |
---|
[b5884b3] | 149 | RS12_OBJ_FILES = rs12.o |
---|
| 150 | rs12: \$(RS12_OBJ_FILES) |
---|
| 151 | rs12.o: rs12.c |
---|
| 152 | |
---|
[c08f3b1] | 153 | CONFIG_FILES = src/config.h Makefile |
---|
| 154 | |
---|
| 155 | .SUFFIXES: |
---|
[c7ecbc2] | 156 | .SUFFIXES: .l .y .h .c .pl .o .texinfo .info .dvi .html .pdf .ps |
---|
[c08f3b1] | 157 | |
---|
| 158 | .PHONY: help |
---|
| 159 | help: |
---|
[c7ecbc2] | 160 | @\$(MAKE) --print-data-base --question | \\ |
---|
[c08f3b1] | 161 | \$(GREP) '^[^.%][-A-Za-z0-9_]*:' | \\ |
---|
| 162 | \$(CUT) -f 1 -d : | \\ |
---|
[c7ecbc2] | 163 | \$(GREP) -v '^Makefile\$\$' | \\ |
---|
[c08f3b1] | 164 | \$(SORT) | \\ |
---|
| 165 | \$(PR) --omit-pagination --width=80 --columns=4 |
---|
| 166 | |
---|
[9a36761] | 167 | .PHONY: all |
---|
| 168 | all: \$(PROGRAMS) |
---|
| 169 | |
---|
[c7ecbc2] | 170 | .PHONY: doc |
---|
| 171 | doc: info dvi html pdf ps |
---|
[9a36761] | 172 | |
---|
| 173 | .PHONY: info |
---|
| 174 | info: utt.info |
---|
| 175 | |
---|
| 176 | .PHONY: dvi |
---|
| 177 | dvi: utt.dvi |
---|
| 178 | |
---|
| 179 | .PHONY: html |
---|
| 180 | html: utt.html |
---|
| 181 | |
---|
| 182 | .PHONY: pdf |
---|
| 183 | pdf: utt.pdf |
---|
| 184 | |
---|
| 185 | .PHONY: ps |
---|
| 186 | ps: utt.ps |
---|
| 187 | |
---|
[c7ecbc2] | 188 | .PHONY: install-all |
---|
| 189 | install-all: install install-doc |
---|
[9a36761] | 190 | |
---|
[c7ecbc2] | 191 | .PHONY: installdirs |
---|
| 192 | installdirs: |
---|
| 193 | \$(INSTALL_DIR) \$(DESTDIR)\$(prefix) \\ |
---|
| 194 | \$(DESTDIR)\$(exec_prefix) \\ |
---|
| 195 | \$(DESTDIR)\$(bindir) \\ |
---|
| 196 | \$(DESTDIR)\$(datarootdir) \\ |
---|
| 197 | \$(DESTDIR)\$(datadir) \\ |
---|
| 198 | \$(DESTDIR)\$(docdir) \\ |
---|
| 199 | \$(DESTDIR)\$(infodir) \\ |
---|
| 200 | \$(DESTDIR)\$(htmldir) \\ |
---|
| 201 | \$(DESTDIR)\$(dvidir) \\ |
---|
| 202 | \$(DESTDIR)\$(pdfdir) \\ |
---|
| 203 | \$(DESTDIR)\$(psdir) \\ |
---|
| 204 | |
---|
| 205 | .PHONY: install |
---|
| 206 | install: installdirs |
---|
| 207 | \$(INSTALL_PROGRAM) \$(PROGRAMS) \$(DESTDIR)\$(bindir) |
---|
| 208 | |
---|
| 209 | .PHONY: install-strip |
---|
| 210 | install-strip: installdirs |
---|
| 211 | \$(INSTALL_PROGRAM) \$(PROGRAMS_SCRIPT) \$(DESTDIR)\$(bindir) |
---|
| 212 | \$(INSTALL_PROGRAM_STRIP) \$(PROGRAMS_EXEC) \$(DESTDIR)\$(bindir) |
---|
| 213 | |
---|
| 214 | .PHONY: install-doc |
---|
| 215 | install-doc: install-info install-dvi install-html install-pdf install-ps |
---|
| 216 | |
---|
| 217 | .PHONY: install-info |
---|
| 218 | install-info: installdirs |
---|
| 219 | \$(INSTALL_DATA) utt.info \$(DESTDIR)\$(infodir) |
---|
| 220 | |
---|
| 221 | .PHONY: install-dvi |
---|
| 222 | install-dvi: installdirs |
---|
| 223 | \$(INSTALL_DATA) utt.dvi \$(DESTDIR)\$(dvidir) |
---|
| 224 | |
---|
| 225 | .PHONY: install-html |
---|
| 226 | install-html: installdirs |
---|
| 227 | \$(INSTALL_DATA) utt.html \$(DESTDIR)\$(htmldir) |
---|
| 228 | |
---|
| 229 | .PHONY: install-pdf |
---|
| 230 | install-pdf: installdirs |
---|
| 231 | \$(INSTALL_DATA) utt.pdf \$(DESTDIR)\$(pdfdir) |
---|
| 232 | |
---|
| 233 | .PHONY: install-ps |
---|
| 234 | install-ps: installdirs |
---|
| 235 | \$(INSTALL_DATA) utt.ps \$(DESTDIR)\$(psdir) |
---|
| 236 | |
---|
[9a36761] | 237 | .PHONY: uninstall |
---|
| 238 | uninstall: |
---|
[c7ecbc2] | 239 | \$(RM) \$(foreach file,\$(PROGRAMS),\$(DESTDIR)\$(bindir)/\$(file)) |
---|
| 240 | \$(RM) \$(DESTDIR)\$(infodir)/utt.info |
---|
| 241 | \$(RM) \$(DESTDIR)\$(dvidir)/utt.dvi |
---|
| 242 | \$(RM) \$(DESTDIR)\$(htmldir)/utt.html |
---|
| 243 | \$(RM) \$(DESTDIR)\$(pdfdir)/utt.pdf |
---|
| 244 | \$(RM) \$(DESTDIR)\$(psdir)/utt.ps |
---|
| 245 | \$(RMDIR) \$(DESTDIR)\$(docdir) |
---|
[c08f3b1] | 246 | |
---|
| 247 | .PHONY: clean |
---|
| 248 | clean: |
---|
| 249 | \$(RM) \$(PROGRAMS) |
---|
| 250 | \$(RM) \$(TOK_OBJ_FILES) |
---|
[44f59b8] | 251 | \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES)) |
---|
[12743b9] | 252 | \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES)) |
---|
| 253 | \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES)) |
---|
[3a2ae91] | 254 | \$(RM) \$(SEN_OBJ_FILES) |
---|
[1e551bd] | 255 | \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES)) |
---|
[3a2ae91] | 256 | \$(RM) \$(FLA_OBJ_FILES) |
---|
[b5884b3] | 257 | \$(RM) \$(RS12_OBJ_FILES) |
---|
[9a36761] | 258 | \$(RM) \$(DOC_FILES) |
---|
[c08f3b1] | 259 | |
---|
| 260 | .PHONY: distclean |
---|
| 261 | distclean: clean |
---|
| 262 | \$(RM) \$(CONFIG_FILES) |
---|
| 263 | |
---|
| 264 | %.o: %.c |
---|
| 265 | \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS) |
---|
| 266 | |
---|
[12743b9] | 267 | %.c: %.l |
---|
[44f59b8] | 268 | \$(FLEX) -t \$< > \$@ |
---|
| 269 | |
---|
[12743b9] | 270 | %.c: %.ggo |
---|
[e4cec26] | 271 | gengetopt --input \$< --file-name \$(basename \$@) --conf-parser |
---|
[12743b9] | 272 | |
---|
| 273 | %.h: %.ggo |
---|
[e4cec26] | 274 | gengetopt --input \$< --file-name \$(basename \$@) --conf-parser |
---|
[12743b9] | 275 | |
---|
[c08f3b1] | 276 | %: %.o |
---|
| 277 | \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS) |
---|
| 278 | |
---|
[e4cec26] | 279 | %: %.pl |
---|
| 280 | \$(CP) \$< \$@ |
---|
| 281 | \$(CHMOD) a+x \$@ |
---|
| 282 | |
---|
[1e572e1] | 283 | %: %.sh |
---|
| 284 | \$(CP) \$< \$@ |
---|
| 285 | \$(CHMOD) a+x \$@ |
---|
| 286 | |
---|
[4518a0b] | 287 | %: %.sed |
---|
| 288 | \$(CP) \$< \$@ |
---|
| 289 | \$(CHMOD) a+x \$@ |
---|
| 290 | |
---|
[9a36761] | 291 | %.info: %.texinfo |
---|
| 292 | \$(MAKEINFO) \$< -o \$@ |
---|
| 293 | |
---|
| 294 | %.dvi: %.texinfo |
---|
| 295 | \$(TEXI2DVI) --build=clean \$< -o \$@ |
---|
| 296 | |
---|
| 297 | %.html: %.texinfo |
---|
| 298 | \$(MAKEINFO) --html --no-split \$< -o \$@ |
---|
| 299 | |
---|
| 300 | %.pdf: %.texinfo |
---|
| 301 | \$(TEXI2PDF) --build=clean \$< -o \$@ |
---|
| 302 | |
---|
| 303 | %.ps: %.dvi |
---|
| 304 | \$(DVIPS) \$< -o \$@ |
---|
| 305 | |
---|
[c08f3b1] | 306 | EOF |
---|
| 307 | |
---|