-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.def
169 lines (134 loc) · 4.62 KB
/
Makefile.def
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
###############################################################################
# Makefile (and Makefile.def) -- Makefile for the LC-3 tools
#
# "Copyright (c) 2003 by Steven S. Lumetta."
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written
# agreement is hereby granted, provided that the above copyright notice
# and the following two paragraphs appear in all copies of this software,
# that the files COPYING and NO_WARRANTY are included verbatim with
# any distribution, and that the contents of the file README are included
# verbatim as part of a file named README with any distribution.
#
# IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
# INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
# OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR
# HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
# BASIS, AND THE AUTHOR NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
# UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
#
# Author: Steve Lumetta
# Version: 1
# Creation Date: 18 October 2003
# Filename: Makefile[.def]
# History:
# SSL 2 31 October 2003
# Added lc3convert tool into distribution.
# SSL 1 18 October 2003
# Copyright notices and Gnu Public License marker added.
#
###############################################################################
# These path names are automatically set by configure.
GCC = __GCC__
FLEX = __FLEX__
EXE = __EXE__
OS_SIM_LIBS = __OS_SIM_LIBS__
RM = __RM__
CP = __CP__
MKDIR = __MKDIR__
CHMOD = __CHMOD__
SED = __SED__
WISH = __WISH__
RLIPATH = __RLIPATH__
RLLPATH = __RLLPATH__
USE_READLINE = __USE_READLINE__
INSTALL_DIR = __INSTALL_DIR__
CODE_FONT = __CODE_FONT__
BUTTON_FONT = __BUTTON_FONT__
CONSOLE_FONT = __CONSOLE_FONT__
# End of configuration block.
CFLAGS = -g -Wall
LDFLAGS = -g
LC3AS = ./lc3as
ALL: dist_lc3as dist_lc3convert dist_lc3sim dist_lc3sim-tk
clean: dist_lc3as_clean dist_lc3convert_clean dist_lc3sim_clean \
dist_lc3sim-tk_clean
clear: dist_lc3as_clear dist_lc3convert_clear dist_lc3sim_clear \
dist_lc3sim-tk_clear
distclean: clean clear
${RM} -f Makefile
install: ALL
${MKDIR} -p ${INSTALL_DIR}
-${CP} -f lc3as${EXE} lc3convert${EXE} lc3sim${EXE} lc3os.obj \
lc3os.sym lc3sim-tk COPYING NO_WARRANTY README ${INSTALL_DIR}
${CHMOD} 555 ${INSTALL_DIR}/lc3as${EXE} \
${INSTALL_DIR}/lc3convert${EXE} ${INSTALL_DIR}/lc3sim${EXE} \
${INSTALL_DIR}/lc3sim-tk
${CHMOD} 444 ${INSTALL_DIR}/lc3os.obj ${INSTALL_DIR}/lc3os.sym \
${INSTALL_DIR}/COPYING ${INSTALL_DIR}/NO_WARRANTY \
${INSTALL_DIR}/README
%.o: %.c
${GCC} -c ${CFLAGS} -o $@ $<
#
# Makefile fragment for lc3as
#
dist_lc3as: lc3as${EXE}
lc3as${EXE}: lex.lc3.o symbol.o
${GCC} ${LDFLAGS} -o lc3as${EXE} lex.lc3.o symbol.o
lex.lc3.c: lc3.f
${FLEX} -i -Plc3 lc3.f
dist_lc3as_clean::
${RM} -f lex.lc3.c *.o *~
dist_lc3as_clear: dist_lc3as_clean
${RM} -f lc3as${EXE}
#
# Makefile fragment for lc3convert
#
dist_lc3convert: lc3convert${EXE}
lc3convert${EXE}: lex.lc3convert.o
${GCC} ${LDFLAGS} -o lc3convert${EXE} lex.lc3convert.o
lex.lc3convert.c: lc3convert.f
${FLEX} -i -Plc3convert lc3convert.f
dist_lc3convert_clean::
${RM} -f lex.lc3convert.c *.o *~
dist_lc3convert_clear: dist_lc3convert_clean
${RM} -f lc3convert${EXE}
#
# Makefile fragment for lc3sim
#
dist_lc3sim: lc3sim${EXE} lc3os.obj lc3os.sym
lc3sim${EXE}: lc3sim.o sim_symbol.o
${GCC} ${LDFLAGS} ${RLIPATH} -o lc3sim${EXE} \
lc3sim.o sim_symbol.o ${RLLPATH} ${OS_SIM_LIBS}
lc3os.obj: ${LC3AS} lc3os.asm
${LC3AS} lc3os
lc3os.sym: ${LC3AS} lc3os.asm
${LC3AS} lc3os
lc3sim.o: lc3sim.c lc3.def lc3sim.h symbol.h
${GCC} -c ${CFLAGS} ${USE_READLINE} -DINSTALL_DIR="\"${INSTALL_DIR}\"" -DMAP_LOCATION_TO_SYMBOL -o lc3sim.o lc3sim.c
sim_symbol.o: symbol.c symbol.h
${GCC} -c ${CFLAGS} -DMAP_LOCATION_TO_SYMBOL -o sim_symbol.o symbol.c
dist_lc3sim_clean::
${RM} -f *.o *~
dist_lc3sim_clear: dist_lc3sim_clean
${RM} -f lc3sim${EXE} lc3os.obj lc3os.sym
#
# Makefile fragment for lc3sim-tk
#
dist_lc3sim-tk: lc3sim-tk
lc3sim-tk: lc3sim-tk.def
${SED} -e 's @@WISH@@ ${WISH} g' \
-e 's*@@LC3_SIM@@*"${INSTALL_DIR}/lc3sim"*g' \
-e 's!@@CODE_FONT@@!${CODE_FONT}!g' \
-e 's!@@BUTTON_FONT@@!${BUTTON_FONT}!g' \
-e 's!@@CONSOLE_FONT@@!${CONSOLE_FONT}!g' \
lc3sim-tk.def > lc3sim-tk
${CHMOD} u+x lc3sim-tk
dist_lc3sim-tk_clean::
dist_lc3sim-tk_clear::
${RM} -f lc3sim-tk