[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 | |
---|
[743cc4f] | 99 | PROGRAMS_SCRIPT = gph kot unfla grp mar ser kon rm12 uam.tag2re sen-nl |
---|
[c7ecbc2] | 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 | |
---|
[a26cf42] | 128 | UAMTAG2RE_PERL_FILES = uam.tag2re.pl |
---|
| 129 | uam.tag2re: \$(UAMTAG2RE_PERL_FILES) |
---|
| 130 | |
---|
[3a2ae91] | 131 | KOT_PERL_FILES = kot.pl |
---|
| 132 | kot: \$(KOT_PERL_FILES) |
---|
[e4cec26] | 133 | |
---|
[1e572e1] | 134 | UNFLA_SH_FILES = unfla.sh |
---|
| 135 | unfla: \$(UNFLA_SH_FILES) |
---|
| 136 | |
---|
[ac9a049] | 137 | GRP_PERL_FILES = grp.pl |
---|
| 138 | grp: \$(GRP_PERL_FILES) |
---|
| 139 | |
---|
[dc21769] | 140 | MAR_PERL_FILES = mar.pl |
---|
| 141 | mar: \$(MAR_PERL_FILES) |
---|
| 142 | |
---|
[8c8a252] | 143 | SER_PERL_FILES = ser.pl |
---|
| 144 | ser: \$(SER_PERL_FILES) |
---|
| 145 | |
---|
[8e1730c] | 146 | KON_PERL_FILES = kon.pl |
---|
| 147 | kon: \$(KON_PERL_FILES) |
---|
| 148 | |
---|
[4518a0b] | 149 | RM12_SED_FILES = rm12.sed |
---|
| 150 | rm12: \$(RM12_SED_FILES) |
---|
| 151 | |
---|
[743cc4f] | 152 | SENNL_SED_FILES = sen-nl.sed |
---|
| 153 | sen-nl: \$(SENNL_SED_FILES) |
---|
| 154 | |
---|
[b5884b3] | 155 | RS12_OBJ_FILES = rs12.o |
---|
| 156 | rs12: \$(RS12_OBJ_FILES) |
---|
| 157 | rs12.o: rs12.c |
---|
| 158 | |
---|
[c08f3b1] | 159 | CONFIG_FILES = src/config.h Makefile |
---|
| 160 | |
---|
| 161 | .SUFFIXES: |
---|
[c7ecbc2] | 162 | .SUFFIXES: .l .y .h .c .pl .o .texinfo .info .dvi .html .pdf .ps |
---|
[c08f3b1] | 163 | |
---|
| 164 | .PHONY: help |
---|
| 165 | help: |
---|
[c7ecbc2] | 166 | @\$(MAKE) --print-data-base --question | \\ |
---|
[c08f3b1] | 167 | \$(GREP) '^[^.%][-A-Za-z0-9_]*:' | \\ |
---|
| 168 | \$(CUT) -f 1 -d : | \\ |
---|
[c7ecbc2] | 169 | \$(GREP) -v '^Makefile\$\$' | \\ |
---|
[c08f3b1] | 170 | \$(SORT) | \\ |
---|
| 171 | \$(PR) --omit-pagination --width=80 --columns=4 |
---|
| 172 | |
---|
[9a36761] | 173 | .PHONY: all |
---|
| 174 | all: \$(PROGRAMS) |
---|
| 175 | |
---|
[c7ecbc2] | 176 | .PHONY: doc |
---|
| 177 | doc: info dvi html pdf ps |
---|
[9a36761] | 178 | |
---|
| 179 | .PHONY: info |
---|
| 180 | info: utt.info |
---|
| 181 | |
---|
| 182 | .PHONY: dvi |
---|
| 183 | dvi: utt.dvi |
---|
| 184 | |
---|
| 185 | .PHONY: html |
---|
| 186 | html: utt.html |
---|
| 187 | |
---|
| 188 | .PHONY: pdf |
---|
| 189 | pdf: utt.pdf |
---|
| 190 | |
---|
| 191 | .PHONY: ps |
---|
| 192 | ps: utt.ps |
---|
| 193 | |
---|
[c7ecbc2] | 194 | .PHONY: install-all |
---|
| 195 | install-all: install install-doc |
---|
[9a36761] | 196 | |
---|
[c7ecbc2] | 197 | .PHONY: installdirs |
---|
| 198 | installdirs: |
---|
| 199 | \$(INSTALL_DIR) \$(DESTDIR)\$(prefix) \\ |
---|
| 200 | \$(DESTDIR)\$(exec_prefix) \\ |
---|
| 201 | \$(DESTDIR)\$(bindir) \\ |
---|
| 202 | \$(DESTDIR)\$(datarootdir) \\ |
---|
| 203 | \$(DESTDIR)\$(datadir) \\ |
---|
| 204 | \$(DESTDIR)\$(docdir) \\ |
---|
| 205 | \$(DESTDIR)\$(infodir) \\ |
---|
| 206 | \$(DESTDIR)\$(htmldir) \\ |
---|
| 207 | \$(DESTDIR)\$(dvidir) \\ |
---|
| 208 | \$(DESTDIR)\$(pdfdir) \\ |
---|
| 209 | \$(DESTDIR)\$(psdir) \\ |
---|
| 210 | |
---|
| 211 | .PHONY: install |
---|
| 212 | install: installdirs |
---|
| 213 | \$(INSTALL_PROGRAM) \$(PROGRAMS) \$(DESTDIR)\$(bindir) |
---|
| 214 | |
---|
| 215 | .PHONY: install-strip |
---|
| 216 | install-strip: installdirs |
---|
| 217 | \$(INSTALL_PROGRAM) \$(PROGRAMS_SCRIPT) \$(DESTDIR)\$(bindir) |
---|
| 218 | \$(INSTALL_PROGRAM_STRIP) \$(PROGRAMS_EXEC) \$(DESTDIR)\$(bindir) |
---|
| 219 | |
---|
| 220 | .PHONY: install-doc |
---|
| 221 | install-doc: install-info install-dvi install-html install-pdf install-ps |
---|
| 222 | |
---|
| 223 | .PHONY: install-info |
---|
| 224 | install-info: installdirs |
---|
| 225 | \$(INSTALL_DATA) utt.info \$(DESTDIR)\$(infodir) |
---|
| 226 | |
---|
| 227 | .PHONY: install-dvi |
---|
| 228 | install-dvi: installdirs |
---|
| 229 | \$(INSTALL_DATA) utt.dvi \$(DESTDIR)\$(dvidir) |
---|
| 230 | |
---|
| 231 | .PHONY: install-html |
---|
| 232 | install-html: installdirs |
---|
| 233 | \$(INSTALL_DATA) utt.html \$(DESTDIR)\$(htmldir) |
---|
| 234 | |
---|
| 235 | .PHONY: install-pdf |
---|
| 236 | install-pdf: installdirs |
---|
| 237 | \$(INSTALL_DATA) utt.pdf \$(DESTDIR)\$(pdfdir) |
---|
| 238 | |
---|
| 239 | .PHONY: install-ps |
---|
| 240 | install-ps: installdirs |
---|
| 241 | \$(INSTALL_DATA) utt.ps \$(DESTDIR)\$(psdir) |
---|
| 242 | |
---|
[9a36761] | 243 | .PHONY: uninstall |
---|
| 244 | uninstall: |
---|
[c7ecbc2] | 245 | \$(RM) \$(foreach file,\$(PROGRAMS),\$(DESTDIR)\$(bindir)/\$(file)) |
---|
| 246 | \$(RM) \$(DESTDIR)\$(infodir)/utt.info |
---|
| 247 | \$(RM) \$(DESTDIR)\$(dvidir)/utt.dvi |
---|
| 248 | \$(RM) \$(DESTDIR)\$(htmldir)/utt.html |
---|
| 249 | \$(RM) \$(DESTDIR)\$(pdfdir)/utt.pdf |
---|
| 250 | \$(RM) \$(DESTDIR)\$(psdir)/utt.ps |
---|
| 251 | \$(RMDIR) \$(DESTDIR)\$(docdir) |
---|
[c08f3b1] | 252 | |
---|
| 253 | .PHONY: clean |
---|
| 254 | clean: |
---|
| 255 | \$(RM) \$(PROGRAMS) |
---|
| 256 | \$(RM) \$(TOK_OBJ_FILES) |
---|
[44f59b8] | 257 | \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES)) |
---|
[12743b9] | 258 | \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES)) |
---|
| 259 | \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES)) |
---|
[3a2ae91] | 260 | \$(RM) \$(SEN_OBJ_FILES) |
---|
[1e551bd] | 261 | \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES)) |
---|
[3a2ae91] | 262 | \$(RM) \$(FLA_OBJ_FILES) |
---|
[b5884b3] | 263 | \$(RM) \$(RS12_OBJ_FILES) |
---|
[9a36761] | 264 | \$(RM) \$(DOC_FILES) |
---|
[c08f3b1] | 265 | |
---|
| 266 | .PHONY: distclean |
---|
| 267 | distclean: clean |
---|
| 268 | \$(RM) \$(CONFIG_FILES) |
---|
| 269 | |
---|
| 270 | %.o: %.c |
---|
| 271 | \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS) |
---|
| 272 | |
---|
[12743b9] | 273 | %.c: %.l |
---|
[44f59b8] | 274 | \$(FLEX) -t \$< > \$@ |
---|
| 275 | |
---|
[12743b9] | 276 | %.c: %.ggo |
---|
[e4cec26] | 277 | gengetopt --input \$< --file-name \$(basename \$@) --conf-parser |
---|
[12743b9] | 278 | |
---|
| 279 | %.h: %.ggo |
---|
[e4cec26] | 280 | gengetopt --input \$< --file-name \$(basename \$@) --conf-parser |
---|
[12743b9] | 281 | |
---|
[c08f3b1] | 282 | %: %.o |
---|
| 283 | \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS) |
---|
| 284 | |
---|
[e4cec26] | 285 | %: %.pl |
---|
| 286 | \$(CP) \$< \$@ |
---|
| 287 | \$(CHMOD) a+x \$@ |
---|
| 288 | |
---|
[1e572e1] | 289 | %: %.sh |
---|
| 290 | \$(CP) \$< \$@ |
---|
| 291 | \$(CHMOD) a+x \$@ |
---|
| 292 | |
---|
[4518a0b] | 293 | %: %.sed |
---|
| 294 | \$(CP) \$< \$@ |
---|
| 295 | \$(CHMOD) a+x \$@ |
---|
| 296 | |
---|
[9a36761] | 297 | %.info: %.texinfo |
---|
| 298 | \$(MAKEINFO) \$< -o \$@ |
---|
| 299 | |
---|
| 300 | %.dvi: %.texinfo |
---|
| 301 | \$(TEXI2DVI) --build=clean \$< -o \$@ |
---|
| 302 | |
---|
| 303 | %.html: %.texinfo |
---|
| 304 | \$(MAKEINFO) --html --no-split \$< -o \$@ |
---|
| 305 | |
---|
| 306 | %.pdf: %.texinfo |
---|
| 307 | \$(TEXI2PDF) --build=clean \$< -o \$@ |
---|
| 308 | |
---|
| 309 | %.ps: %.dvi |
---|
| 310 | \$(DVIPS) \$< -o \$@ |
---|
| 311 | |
---|
[c08f3b1] | 312 | EOF |
---|
| 313 | |
---|