| 1 |
## -*- mode: Makefile-Automake -*- |
| 2 |
## |
| 3 |
## Copyright (c) 2013, 2015, 2016 The University of Utah |
| 4 |
## All rights reserved. |
| 5 |
## |
| 6 |
## This file is distributed under the University of Illinois Open Source |
| 7 |
## License. See the file COPYING for details. |
| 8 |
|
| 9 |
############################################################################### |
| 10 |
|
| 11 |
libexec_PROGRAMS = clex strlex |
| 12 |
|
| 13 |
clex_CPPFLAGS = |
| 14 |
|
| 15 |
clex_SOURCES = \ |
| 16 |
clex.l \ |
| 17 |
defs.h \ |
| 18 |
driver.c |
| 19 |
|
| 20 |
strlex_CPPFLAGS = |
| 21 |
|
| 22 |
strlex_SOURCES = \ |
| 23 |
strlex.l \ |
| 24 |
defs.h \ |
| 25 |
driver.c |
| 26 |
|
| 27 |
EXTRA_DIST = \ |
| 28 |
CMakeLists.txt |
| 29 |
|
| 30 |
# SHORT STORY: Always rebuild `clex.c' from `clex.l' if Make thinks that |
| 31 |
# `clex.c' is out of date. This is achieved by a sinful Automake hack. |
| 32 |
# |
| 33 |
am__skiplex := |
| 34 |
# |
| 35 |
# LONG STORY: We use AM_MAINTAINER_MODE in C-Reduce so as to avoid rebuilding |
| 36 |
# our `configure' and `Makefile.in' files unnecessarily. (The mode is disabled |
| 37 |
# by default, meaning that `configure' avoids creating Makefile rules that |
| 38 |
# perform various "package maintenance activities.") |
| 39 |
# |
| 40 |
# Automake handles lex-derived C files specially when AM_MAINTAINER_MODE is |
| 41 |
# used. It treats regeneration of the C file is a maintenance activity, not a |
| 42 |
# normal compilation activity. Treating lex as a maintenance activity is a |
| 43 |
# pain in the ass for C-Reduce developers, because it means that they must do |
| 44 |
# something more than `make' when they change `clex.l' and want to recompile. |
| 45 |
# |
| 46 |
# Automake short-circuits the `.l' -> `.c' compilation step by testing if the |
| 47 |
# target `.c' file already exists. This is implemented by the Make macro |
| 48 |
# `am__skiplex', which is prefixed to the usual command line for running lex: |
| 49 |
# |
| 50 |
# am__skiplex = test -f $@ || |
| 51 |
# |
| 52 |
# (This macro is not defined when AM_MAINTAINER_MODE is not used, nor is it |
| 53 |
# defined when maintainer mode is enabled by the user. But I digress.) |
| 54 |
# |
| 55 |
# We don't want to treat running lex as a maintenance activity; we want to |
| 56 |
# treat it as a normal compilation activity. We achieve this by redefining the |
| 57 |
# internal `am__skiplex' macro, thus avoiding the short-circuit described |
| 58 |
# above. This implementation is icky and sinful because `am__skiplex' is |
| 59 |
# internal to Automake and undocumented. It works with Automake 1.13.2. |
| 60 |
# |
| 61 |
# Treating lex/yacc as special makes some sense historically, when the builder |
| 62 |
# of a package could not be assumed to have working, installed copies of those |
| 63 |
# tools. But I think it's a pretty obsolete viewpoint today. |
| 64 |
|
| 65 |
############################################################################### |
| 66 |
|
| 67 |
## End of file. |