File: Makefile.in

package info (click to toggle)
vbpp 1.1.0-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 480 kB
  • ctags: 277
  • sloc: sh: 2,496; ansic: 1,474; lex: 1,097; yacc: 511; makefile: 157
file content (142 lines) | stat: -rw-r--r-- 3,759 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Verilog PreProcessor
#
# This file was contributed to VPP by Jimen Ching.  Users are granted the
# same rights as that given to VPP itself.  The author disclaims all
# warranty or whatever.
#
# This line was specificly left blank, to be replaced by the Copyright.
#

# Basic shell commands
SHELL = /bin/sh

srcdir = @srcdir@
top_srcdir = @top_srcdir@
EX_DIR = $(srcdir)/EXAMPLES

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@

# Configure generated macros
CC = @CC@
YACC = @YACC@
LEX = @LEX@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LEXLIB = @LEXLIB@
LIBS = @LIBS@
INSTALL = @INSTALL@
@SET_MAKE@

# Program to process examples
VPP = ./vpp

#
# NO NEED TO MODIFY BELOW THIS LINE!!!
#

CFLAGS := $(CFLAGS) -I$(srcdir) -I.

OBJS = vpp_yacc.o vpp_lex.o create.o vpp.o

VPATH = @srcdir@

.SUFFIXES:

%.o: %.c
	$(CC) $(CFLAGS) -c $<

all:
	@echo ""
	@echo "Type 'make target', where target is one of"
	@echo "the targets below:"
	@echo ""
	@echo "     vpp ............. compile preprocessor"
	@echo "     examples ........ process examples"
	@echo "     clean ........... clean up vpp object files"
	@echo "     distclean ....... clean up for distribution"
	@echo "     tarball ......... create tarball for distribution"
	@echo ""

vpp: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(LEXLIB)

Makefile: $(srcdir)/Makefile.in
	./config.status

tarball:
	cd $(top_srcdir)/..; \
	echo "CVS" > .exclude-files; \
	echo "Entries" >> .exclude-files; \
	echo "Repository" >> .exclude-files; \
	echo "Root" >> .exclude-files; \
	ln -s vbpp vbpp-$(VERNAME); \
	tar -X .exclude-files -chf vbpp-$(VERNAME).tar vbpp-$(VERNAME); \
	gzip -9 vbpp-$(VERNAME).tar; \
	rm .exclude-files; \
	rm vbpp-$(VERNAME); \
	echo The tarball is created at `pwd`.

dep depend: vpp_yacc.c vpp_lex.c
	$(CC) -M $(CFLAGS) $(srcdir)/*.c *.c > .tmpdepend
	mv .tmpdepend .depend

clean:
	rm -f *.o core a.out

distclean: clean
	rm -f .depend .tmpdepend vpp_yacc.h vpp_yacc.c vpp_lex.c vpp

maintainer-clean: distclean
	rm -f Makefile config.log config.status config.cache

install:
	$(INSTALL) -d $(DESTDIR)$(bindir)
	$(INSTALL) vpp $(DESTDIR)$(bindir)

vpp_lex.c: $(srcdir)/vpp.l
	$(LEX) -o$@ $(srcdir)/vpp.l

vpp_yacc.c vpp_yacc.h: $(srcdir)/vpp.y
	$(YACC) -o $@ $(srcdir)/vpp.y

examples: ex_basic ex_complex ex_errors

ex_basic:
	@$(VPP) $(EX_DIR)/assignments.vpp > ex.out     2>&1
	@$(VPP) $(EX_DIR)/expression.vpp >> ex.out     2>&1
	@$(VPP) $(EX_DIR)/nested_for.vpp >> ex.out     2>&1
	@$(VPP) $(EX_DIR)/simple_for.vpp >> ex.out     2>&1
	@$(VPP) $(EX_DIR)/simple_if.vpp >> ex.out      2>&1
	@$(VPP) $(EX_DIR)/simple_ifndef.vpp >> ex.out  2>&1
	@$(VPP) $(EX_DIR)/simple_switch.vpp >> ex.out  2>&1
	@$(VPP) $(EX_DIR)/simple_while.vpp >> ex.out   2>&1
	@$(VPP) $(EX_DIR)/some_math.vpp >> ex.out      2>&1
	@echo -n "Number of lines with errors in basic examples:   "
	@diff ex.out $(EX_DIR)/0exout-template | wc -l
	@rm -f ex.out

ex_complex:
	@$(VPP) $(EX_DIR)/x_for.vpp > ex.out     2>&1
	@$(VPP) $(EX_DIR)/x_forif.vpp >> ex.out  2>&1
	@$(VPP) $(EX_DIR)/x_iffw.vpp >> ex.out   2>&1
	@$(VPP) $(EX_DIR)/x_swfw.vpp >> ex.out   2>&1
	@$(VPP) $(EX_DIR)/x_arguments.vpp >> ex.out   2>&1
	@$(VPP) -Dlimit=2 $(EX_DIR)/x_cmddefine.vpp >> ex.out   2>&1
	@$(VPP) +incdir+$(EX_DIR)+ $(EX_DIR)/x_inc.vpp >> ex.out   2>&1
	@$(VPP) -E $(EX_DIR)/x_macro.vpp >> ex.out   2>&1
	@echo -n "Number of lines with errors in complex examples: "
	@diff ex.out $(EX_DIR)/1exout-template | wc -l
	@rm -f ex.out

ex_errors:
	@echo "The ignored errors below are expected:"
	-@$(VPP) $(EX_DIR)/x_define.vpp > ex.out   2>&1
	@echo -n "Number of lines with errors in error examples:   "
	@diff ex.out $(EX_DIR)/2exout-template | wc -l
	@rm -f ex.out

ifeq (.depend,$(wildcard .depend))
include .depend
endif