#
|
#
|
# Makefile for ECO32 simulator
|
# Makefile for ECO32 simulator
|
#
|
#
|
|
|
BUILD = ../build
|
BUILD = ../build
|
|
|
CC = gcc -m32
|
CC = gcc
|
CFLAGS = -g -Wall -I./getline -I/usr/X11R7/include
|
CFLAGS = -g -Wall -I./getline -I/usr/X11R7/include
|
LDFLAGS = -g -L./getline -L/usr/X11R7/lib -Wl,-rpath -Wl,/usr/X11R7/lib
|
LDFLAGS = -g -L./getline -L/usr/X11R7/lib -Wl,-rpath -Wl,/usr/X11R7/lib
|
LDLIBS = -lgetline -lX11 -lpthread -lm
|
LDLIBS = -lgetline -lX11 -lpthread -lm
|
|
|
SRCS = main.c console.c error.c except.c command.c \
|
SRCS = main.c console.c error.c except.c command.c \
|
instr.c asm.c disasm.c cpu.c mmu.c memory.c \
|
instr.c asm.c disasm.c cpu.c mmu.c memory.c \
|
timer.c dspkbd.c serial.c disk.c output.c \
|
timer.c dspkbd.c serial.c disk.c output.c \
|
shutdown.c graph.c
|
shutdown.c graph.c
|
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
BIN = sim
|
BIN = sim
|
|
|
.PHONY: all install clean
|
.PHONY: all install clean
|
|
|
all: $(BIN)
|
all: $(BIN)
|
|
|
install: $(BIN)
|
install: $(BIN)
|
mkdir -p $(BUILD)/bin
|
mkdir -p $(BUILD)/bin
|
cp $(BIN) $(BUILD)/bin
|
cp $(BIN) $(BUILD)/bin
|
|
|
getline/libgetline.a:
|
getline/libgetline.a:
|
$(MAKE) -C getline
|
$(MAKE) -C getline
|
|
|
$(BIN): $(OBJS) getline/libgetline.a
|
$(BIN): $(OBJS) getline/libgetline.a
|
$(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(LDLIBS)
|
$(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(LDLIBS)
|
|
|
%.o: %.c
|
%.o: %.c
|
$(CC) $(CFLAGS) -o $@ -c $<
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
depend.mak:
|
depend.mak:
|
$(CC) -MM -MG $(CFLAGS) $(SRCS) >depend.mak
|
$(CC) -MM -MG $(CFLAGS) $(SRCS) >depend.mak
|
|
|
-include depend.mak
|
-include depend.mak
|
|
|
clean:
|
clean:
|
$(MAKE) -C getline clean
|
$(MAKE) -C getline clean
|
rm -f *~ $(OBJS) $(BIN) depend.mak
|
rm -f *~ $(OBJS) $(BIN) depend.mak
|
|
|