-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
92 lines (72 loc) · 2.54 KB
/
makefile
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
#
# Makefile to bootstrap after a CVS checkout
#
# NOTE: look in the ATTIC for 'mf' - it was my
# original makefile and might contain
# useful info
#
# if this is checked out for the 'xsyms' module,
# most of the files are missing and we just use
# the trivial rule for 'xsyms'
XSYMS_ONLY_TEST_FILE=cexp.y
all:
@if [ -f Makefile.am ] ; then \
echo ;\
echo This Makefile must be invoked with an explicit target; \
echo ;\
echo Possible Targets are; \
echo ' "prep": regenerate non-CVS/autoxxx files (requires bison-1.28 and autotools)'; \
echo ' "distclean": remove non-CVS files (REQUIRES bison-1.28 AND autotools TO RECREATE)'; \
exit 1; \
fi
prep: $(if $(wildcard $(XSYMS_ONLY_TEST_FILE)),src bootstrap, bootstrap-xsyms)
@echo you may now create a build subdirectory and ../configure the package
YFLAGS=-v -d -p cexp
ifndef BISON
BISON=bison
endif
cexp.tab.c cexp.tab.h: cexp.y
$(BISON) $(YFLAGS) $^
# remove the default rule which tries to make cexp.c from cexp.y
cexp.c: ;
gentab: gentab.c
$(HOSTCC) -O -o $@ $^
jumptab.c: gentab.c
$(HOSTCC) -O -o gentab $^
if ./gentab > $@; then true ; else $(RM) $@ gentab; exit 1; fi
$(RM) gentab
src: cexp.tab.c cexp.tab.h jumptab.c
ifdef tools_prefix
# AUTOPATH = $(tools_prefix)/
# must use the real search path; providing absolute path
# when calling autotools doesn't work because automake seems
# to call 'autoconf'.
PATH:= $(tools_prefix):$(PATH)
endif
ACLOCAL = $(AUTOPATH)aclocal -I$(shell pwd)/m4
AUTOCONF = $(AUTOPATH)autoconf
AUTOHEADER = $(AUTOPATH)autoheader
AUTOMAKE = $(AUTOPATH)automake
bootstrap-xsyms bootstrap-cexp:
$(ACLOCAL) && $(AUTOCONF) && $(AUTOHEADER) && $(AUTOMAKE) -ac$(AUTOFORCE)
# ln -s binutils binutils-x
bootstrap: bootstrap-cexp
(cd libtecla; $(ACLOCAL) && $(AUTOCONF) && $(AUTOMAKE) -ac$(AUTOFORCE))
(cd regexp; $(ACLOCAL) && $(AUTOCONF) && $(AUTOMAKE) -ac$(AUTOFORCE))
(cd pmbfd; $(ACLOCAL) && $(AUTOHEADER) && $(AUTOCONF) && $(AUTOMAKE) -ac$(AUTOFORCE))
AUTOFILES=Makefile.in aclocal.m4 config.guess config.sub
AUTOFILES+=depcomp install-sh missing compile configure config.h.in
AUTODIRS=autom4te.cache
distclean:
$(RM) gentab cexp.output cexp.tab.c cexp.tab.h
$(RM) gentab jumptab.c
$(RM) makefile.top.am makefile.top.in
$(RM) $(AUTOFILES)
$(RM) -r $(AUTODIRS)
$(RM) $(addprefix libtecla/,$(AUTOFILES))
$(RM) -r $(addprefix libtecla/,$(AUTODIRS))
$(RM) $(addprefix pmbfd/,$(AUTOFILES))
$(RM) -r $(addprefix pmbfd/,$(AUTODIRS))
$(RM) $(addprefix regexp/,$(AUTOFILES))
$(RM) -r $(addprefix regexp/,$(AUTODIRS))
HOSTCC:=$(CC)