5 CSRCS
= aicasm.c aicasm_symbol.c
6 YSRCS
= aicasm_gram.y aicasm_macro_gram.y
7 LSRCS
= aicasm_scan.l aicasm_macro_scan.l
9 GENHDRS
= aicdb.h
$(YSRCS
:.y
=.h
)
10 GENSRCS
= $(YSRCS
:.y
=.c
) $(LSRCS
:.l
=.c
)
12 SRCS
= ${CSRCS} ${GENSRCS}
14 clean-files
:= ${GENSRCS} ${GENHDRS} $(YSRCS
:.y
=.output
) $(PROG
)
15 # Override default kernel CFLAGS. This is a userland app.
16 AICASM_CFLAGS
:= -I
/usr
/include -I.
33 $(PROG
): ${GENHDRS} $(SRCS
)
34 $(AICASM_CC
) $(AICASM_CFLAGS
) $(SRCS
) -o
$(PROG
) $(LIBS
)
37 @if
[ -e
"/usr/include/db4/db_185.h" ]; then \
38 echo
"#include <db4/db_185.h>" > aicdb.h
; \
39 elif
[ -e
"/usr/include/db3/db_185.h" ]; then \
40 echo
"#include <db3/db_185.h>" > aicdb.h
; \
41 elif
[ -e
"/usr/include/db2/db_185.h" ]; then \
42 echo
"#include <db2/db_185.h>" > aicdb.h
; \
43 elif
[ -e
"/usr/include/db1/db_185.h" ]; then \
44 echo
"#include <db1/db_185.h>" > aicdb.h
; \
45 elif
[ -e
"/usr/include/db/db_185.h" ]; then \
46 echo
"#include <db/db_185.h>" > aicdb.h
; \
47 elif
[ -e
"/usr/include/db_185.h" ]; then \
48 echo
"#include <db_185.h>" > aicdb.h
; \
50 echo
"*** Install db development libraries"; \
56 # Create a dependency chain in generated files
57 # to avoid concurrent invocations of the single
58 # rule that builds them all.
59 aicasm_gram.c
: aicasm_gram.h
60 aicasm_gram.c aicasm_gram.h
: aicasm_gram.y
61 $(YACC
) $(YFLAGS
) -b
$(<:.y
=) $<
62 mv
$(<:.y
=).tab.c
$(<:.y
=.c
)
63 mv
$(<:.y
=).tab.h
$(<:.y
=.h
)
65 # Create a dependency chain in generated files
66 # to avoid concurrent invocations of the single
67 # rule that builds them all.
68 aicasm_macro_gram.c
: aicasm_macro_gram.h
69 aicasm_macro_gram.c aicasm_macro_gram.h
: aicasm_macro_gram.y
70 $(YACC
) $(YFLAGS
) -b
$(<:.y
=) -p mm
$<
71 mv
$(<:.y
=).tab.c
$(<:.y
=.c
)
72 mv
$(<:.y
=).tab.h
$(<:.y
=.h
)
74 aicasm_scan.c
: aicasm_scan.l
75 $(LEX
) $(LFLAGS
) -o
$@
$<
77 aicasm_macro_scan.c
: aicasm_macro_scan.l
78 $(LEX
) $(LFLAGS
) -Pmm
-o
$@
$<