1# $Id: makefile.in,v 1.26 2023/05/19 23:16:31 tom Exp $ 2# 3# UNIX template-makefile for Berkeley Yacc 4 5THIS = yacc 6 7#### Start of system configuration section. #### 8 9srcdir = @srcdir@ 10VPATH = @srcdir@ 11 12CC = @CC@ 13 14INSTALL = @INSTALL@ 15INSTALL_PROGRAM = @INSTALL_PROGRAM@ 16INSTALL_DATA = @INSTALL_DATA@ 17transform = @program_transform_name@ 18 19DEFINES = 20EXTRA_CFLAGS = @EXTRA_CFLAGS@ 21CPPFLAGS = -I. -I$(srcdir) $(DEFINES) -DHAVE_CONFIG_H -DYYPATCH=`cat $(srcdir)/VERSION` @CPPFLAGS@ 22CFLAGS = @CFLAGS@ $(CPPFLAGS) $(EXTRA_CFLAGS) 23 24LDFLAGS = @LDFLAGS@ 25LIBS = @LIBS@ 26 27AWK = @AWK@ 28CTAGS = @CTAGS@ 29ETAGS = @ETAGS@ 30FGREP = @FGREP@ 31LINT = @LINT@ 32LINTFLAGS = @LINT_OPTS@ 33 34prefix = @prefix@ 35exec_prefix = @exec_prefix@ 36 37datarootdir = @datarootdir@ 38bindir = $(DESTDIR)@bindir@ 39mandir = $(DESTDIR)@mandir@/man1 40manext = 1 41 42testdir = $(srcdir)/test 43 44SKELETON = @SKELETON@ 45x = @EXEEXT@ 46o = .@OBJEXT@ 47 48#### End of system configuration section. #### 49 50SHELL = /bin/sh 51@SET_MAKE@ 52 53H_FILES = \ 54 defs.h 55 56C_FILES = \ 57 closure.c \ 58 error.c \ 59 graph.c \ 60 lalr.c \ 61 lr0.c \ 62 main.c \ 63 mkpar.c \ 64 mstring.c \ 65 output.c \ 66 reader.c \ 67 $(SKELETON).c \ 68 symtab.c \ 69 verbose.c \ 70 warshall.c 71 72OBJS = \ 73 closure$o \ 74 error$o \ 75 graph$o \ 76 lalr$o \ 77 lr0$o \ 78 main$o \ 79 mkpar$o \ 80 mstring$o \ 81 output$o \ 82 reader$o \ 83 $(SKELETON)$o \ 84 symtab$o \ 85 verbose$o \ 86 warshall$o 87 88YACCPAR = \ 89 btyaccpar.c \ 90 yaccpar.c 91 92TRANSFORM_BIN = sed 's/$x$$//' |sed '$(transform)'|sed 's/$$/$x/' 93TRANSFORM_MAN = sed 's/$(manext)$$//'|sed '$(transform)'|sed 's/$$/$(manext)/' 94 95actual_bin = `echo $(THIS)$x | $(TRANSFORM_BIN)` 96actual_man = `echo $(THIS).$(manext)| $(TRANSFORM_MAN)` 97 98all : $(THIS)$x 99 100install: all installdirs 101 $(INSTALL_PROGRAM) $(THIS)$x $(bindir)/$(actual_bin) 102 @ $(SHELL) ./install-man $(srcdir)/$(THIS).1 $(mandir)/$(actual_man) 103 104installdirs: 105 mkdir -p $(bindir) 106 - mkdir -p $(mandir) 107 108uninstall: 109 - rm -f $(bindir)/$(actual_bin) 110 @ $(SHELL) ./install-man $(mandir)/$(actual_man) 111 112################################################################################ 113.SUFFIXES : .c $o .i .skel 114 115.c$o: 116 @RULE_CC@ 117 @ECHO_CC@$(CC) -c $(CFLAGS) $< 118 119.c.i : 120 @RULE_CC@ 121 @ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@ 122 123.skel.c : 124 $(AWK) -f $(srcdir)/skel2c $*.skel > $@ 125 126################################################################################ 127 128$(THIS)$x : $(OBJS) 129 @ECHO_LD@$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS) 130 131mostlyclean : 132 - rm -f core .nfs* *$o *.bak *.BAK *.out 133 134clean :: mostlyclean 135 - rm -f $(THIS)$x 136 137distclean :: clean 138 - rm -f config.log config.cache config.status config.h makefile man2html.tmp install-man* 139 - rm -f $(testdir)/yacc/test-* $(testdir)/btyacc/test-* 140 141realclean :: distclean 142 - rm -f tags TAGS 143 144sources : $(YACCPAR) 145 146maintainer-clean :: realclean 147 rm -f $(YACCPAR) 148 149################################################################################ 150check: $(THIS)$x 151 @echo "** making $@" 152 @FGREP="$(FGREP)" $(SHELL) $(testdir)/run_test.sh $(testdir) 153 154check_make: $(THIS)$x 155 @echo "** making $@" 156 @FGREP="$(FGREP)" $(SHELL) $(testdir)/run_make.sh $(testdir) 157 158check_lint: 159 @echo "** making $@" 160 @FGREP="$(FGREP)" $(SHELL) $(testdir)/run_lint.sh $(testdir) 161################################################################################ 162tags: $(H_FILES) $(C_FILES) 163 $(CTAGS) $(C_FILES) $(H_FILES) 164 165lint: $(C_FILES) 166 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(C_FILES) 167 168@MAKE_UPPER_TAGS@TAGS: $(H_FILES) $(C_FILES) 169@MAKE_UPPER_TAGS@ $(ETAGS) $(C_FILES) $(H_FILES) 170 171depend: 172 makedepend -- $(CPPFLAGS) -- $(C_FILES) 173 174$(OBJS) : defs.h makefile 175 176main$o \ 177$(SKELETON)$o : VERSION 178 179# DO NOT DELETE THIS LINE -- make depend depends on it. 180