-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 753 Bytes
/
Makefile
File metadata and controls
36 lines (28 loc) · 753 Bytes
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
CC = g++
RM = rm -f
CFLAGS = -std=c++98 -O3 -Wall -Wno-write-strings -g
ifndef INSTALLDIR
INSTALLDIR=~/wramp-install/
endif
MKDIR=mkdir -p
COPY=cp
BUILDBINS=wasm wlink wobj
INSTALLBINS=$(INSTALLDIR)wasm $(INSTALLDIR)wlink $(INSTALLDIR)wobj
HEADERS = object_file.h instructions.h
.cpp.o: $(HEADERS) $<
$(CC) $(CFLAGS) -c $<
all: wasm wlink wobj
wasm: assembler.o instructions.o
$(CC) $(CFLAGS) assembler.o instructions.o -o wasm
wlink: linker.o instructions.o
$(CC) $(CFLAGS) linker.o instructions.o -o wlink
wobj: objectViewer.o instructions.o
$(CC) $(CFLAGS) objectViewer.o instructions.o -o wobj
clean:
$(RM) *.o *~
clobber:
$(RM) wasm wlink
$(RM) $(INSTALLBINS)
install: all
$(MKDIR) $(INSTALLDIR)
$(COPY) $(BUILDBINS) $(INSTALLDIR)