-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
108 lines (85 loc) · 3.46 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ident "@(#)cls4:src/makefile 1.7"
###############################################################################
#
# C++ source for the C++ Language System, Release 3.0. This product
# is a new release of the original cfront developed in the computer
# science research center of AT&T Bell Laboratories.
#
# Copyright (c) 1993 UNIX System Laboratories, Inc.
# Copyright (c) 1991,1992 AT&T and UNIX System Laboratories, Inc.
# Copyright (c) 1984, 1989, 1990 AT&T. All Rights Reserved.
#
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of AT&T and UNIX System
#
# Laboratories, Inc. The copyright notice above doesnotevidence
# any actual or intended publication of such source code.
#
###############################################################################
CC = g++-7
IRIX_ROOT := ~/Desktop/indy/indy
YACC = qemu-irix -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/yacc
# YACC := yacc
#The ANSI_OUT option has been replaced by the +a1 and +a0 compilation options
#for systems which only recognize identifiers of up to 31 characters
#setting DENSE to -DDENSE causes cfront to generate internal names
#of 31 characters or less
DENSE=
# The use of RETBUG is nolonger needed with version 2.0 and has been removed.
# RETBUG was used in 1.* Translator versions to circumvent a C compiler bug.
# Uncomment the next line and add -DLICENSE_MAN to the CCFLAGS
# if you want to build a version of cfront that uses a license manager
#
# The LICENSE_LIBS line will change depending upon where your license
# library is located.
#LICENSE_LIBS=Location_of_your_library/libsdelic.a
# use these to sanitize/debug the codebase
SANITIZERS := null,undefined
# address
# SANITIZE_CCFLAGS = -fsanitize=$(SANITIZERS)
# SANITIZE_LDFLAGS = -fsanitize=$(SANITIZERS)
# WARNING
# -fno-for-scope isn't available on newer g++ versions
CCFLAGS=-Wall -Wpedantic -I. -std=c++17 -g -m32 -fno-for-scope -fno-operator-names
# top level makefile modifies the following
MPMACRO = PATCH
MPFILE = patch
BUILD_DIR = build
# always ran
DUMMY != mkdir -p $(BUILD_DIR)
DUMMY != make -C demangler
OFILES := alloc.o Bits.o block.o dcl.o dcl2.o dcl3.o dcl4.o \
del.o discrim.o error.o expand.o \
expr.o expr2.o expr3.o find.o hash.o lalex.o lex.o main.o \
norm.o norm2.o print.o print2.o repr.o simpl.o \
simpl2.o size.o table.o template.o tree_copy.o \
tree_walk.o typ.o typ2.o y.tab.o
O_FILES := $(foreach file,$(OFILES),$(BUILD_DIR)/$(file:.c=.o))
default: cfront
cfront: $(O_FILES)
$(CC) $(CCFLAGS) $(SANITIZE_LDFLAGS) -o cfront $(O_FILES)
$(O_FILES): cfront.h token.h typedef.h
y.tab.c: gram.y
$(YACC) gram.y
$(BUILD_DIR)/%.o: %.c
$(CC) $(CCFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d -c $< -o $@
$(BUILD_DIR)/y.tab.o: y.tab.c
$(CC) -MMD -MP -MT $@ -MF $@.d -DGRAM $(CCFLAGS) -c y.tab.c -o $@
clean:
rm -f -r $(BUILD_DIR) y.tab.c
make -C demangler clean
cpio:
find alloc.c Bits.c block.c dcl.c dcl2.c dcl3.c dcl4.c del.c discrim.c \
error.c expand.c expr.c expr2.c expr3.c find.c hash.c \
lalex.c lex.c main.c norm.c norm2.c print.c print2.c \
repr.c simpl.c simpl2.c size.c table.c \
template.c tree_copy.c tree_walk.c typ.c typ2.c \
overload.h gram.y \
Bits.h Block.h \
cfront.h token.h size.h tqueue.h typedef.h yystype.h \
hash.h node_classes.h \
template.h tree_copy.h tree_walk.h \
makefile -print | cpio -oc > cfront.cpio
# speedup
MAKEFLAGS += --no-builtin-rules
# debug print a variable in this makefile (e.g. `make print-O_FILES`)
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true