Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
[dragonfly.git] / gnu / usr.bin / cc34 / cc_tools / gengtype / Makefile
1 # $DragonFly: src/gnu/usr.bin/cc34/cc_tools/gengtype/Makefile,v 1.3 2005/10/01 12:40:33 corecode Exp $
2
3 .include "../Makefile.inc"
4 .include "../../Makefile.langs"
5
6 SPREPDIR=       ${.CURDIR}/../../cc_prep
7
8 PROG=   gengtype
9 SRCS=   gengtype.c gtyp-gen.h gengtype-lex.l gengtype-yacc.y insn-modes.h
10 SRCS+=  safe-ctype.c xexit.c xmalloc.c xmemdup.c xstrdup.c
11 LDADD=  -ly
12
13 CLEANFILES+=    gtyp-gen.h
14
15 gtyp-gen.h: Makefile ../../Makefile.langs
16         echo "/* This file is machine generated.  Do not edit.  */" > gtyp-gen.h
17         echo "static const char *const srcdir = "  >> gtyp-gen.h
18         echo "\"$(GTFILES_SRCDIR)\"" >> gtyp-gen.h
19         echo ";" >> gtyp-gen.h
20         echo "static const char *const lang_files[] = {" >> gtyp-gen.h
21         ll="$(GTFILES_FILES_FILES)"; \
22         for f in $$ll; do \
23         echo "\"$$f\", "; done >> gtyp-gen.h
24         echo "NULL};" >> gtyp-gen.h
25         echo "static const char *const langs_for_lang_files[] = {" >> gtyp-gen.h
26         ff="$(GTFILES_FILES_LANGS)"; \
27         for f in $$ff; do \
28         echo "\"$$f\", " ; done  >> gtyp-gen.h
29         echo "NULL};" >> gtyp-gen.h
30         echo "static const char *const all_files[] = {" >> gtyp-gen.h
31         gf="$(GTFILES)"; \
32         for f in $$gf; do \
33         echo "\"$$f\", "; done >> gtyp-gen.h
34         echo " NULL};" >> gtyp-gen.h
35         echo "static const char *const lang_dir_names[] = { \"c\", " >> gtyp-gen.h
36         gf="$(GTFILES_LANG_DIR_NAMES)"; \
37         for l in $$gf; do \
38         echo "\"$$l\", "; done >> gtyp-gen.h
39         echo "NULL};" >> gtyp-gen.h
40
41 .include <bsd.hostprog.mk>