2020-07-07 19:16:02 +00:00
|
|
|
.DEFAULT_GOAL: all
|
|
|
|
|
2018-05-03 13:47:57 +00:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
2020-07-07 19:16:02 +00:00
|
|
|
|
|
|
|
CFLAGS = -DDISK_LOG -O0 -g -Wall
|
2020-07-07 00:23:54 +00:00
|
|
|
CXXFLAGS = -DDISK_LOG -O0 -g -Wall
|
|
|
|
|
2020-07-07 19:16:02 +00:00
|
|
|
|
|
|
|
|
2020-07-07 00:23:54 +00:00
|
|
|
# If its not specified, build for STANDARD configuration
|
|
|
|
CONNECT_TYPE ?= STANDARD
|
2020-07-04 14:57:44 +00:00
|
|
|
|
|
|
|
ifdef CONNECT_TYPE
|
|
|
|
CFLAGS += -DCONNECT_TYPE_$(CONNECT_TYPE)
|
|
|
|
CXXFLAGS += -DCONNECT_TYPE_$(CONNECT_TYPE)
|
|
|
|
endif
|
2018-05-03 13:47:57 +00:00
|
|
|
|
|
|
|
RASCSI = rascsi
|
|
|
|
RASCTL = rasctl
|
|
|
|
RASDUMP = rasdump
|
2020-07-04 14:57:44 +00:00
|
|
|
SASIDUMP = sasidump
|
2020-07-07 19:16:02 +00:00
|
|
|
SCSIMON = scsimon
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2020-07-07 19:16:02 +00:00
|
|
|
#BIN_ALL = $(RASCSI) $(RASCTL) $(RASDUMP) $(SASIDUMP) $(SCSIMON)
|
|
|
|
# Temporarily remove the RASDUMP and RASDUMP tools, since they're not needed
|
|
|
|
# for my specific use case. If you need them - add them back in!
|
|
|
|
BIN_ALL = $(RASCSI) $(RASCTL) $(SCSIMON)
|
2020-07-07 00:23:54 +00:00
|
|
|
|
2018-05-03 13:47:57 +00:00
|
|
|
|
|
|
|
SRC_RASCSI = \
|
|
|
|
rascsi.cpp \
|
|
|
|
scsi.cpp \
|
|
|
|
disk.cpp \
|
|
|
|
gpiobus.cpp \
|
|
|
|
ctapdriver.cpp \
|
|
|
|
cfilesystem.cpp \
|
|
|
|
filepath.cpp \
|
|
|
|
fileio.cpp
|
|
|
|
|
|
|
|
SRC_RASCTL = \
|
|
|
|
rasctl.cpp
|
|
|
|
|
|
|
|
SRC_RASDUMP = \
|
|
|
|
rasdump.cpp \
|
|
|
|
scsi.cpp \
|
|
|
|
gpiobus.cpp \
|
|
|
|
filepath.cpp \
|
|
|
|
fileio.cpp
|
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
SRC_SASIDUMP = \
|
|
|
|
sasidump.cpp \
|
|
|
|
scsi.cpp \
|
|
|
|
gpiobus.cpp \
|
|
|
|
filepath.cpp \
|
|
|
|
fileio.cpp
|
|
|
|
|
2020-07-07 19:16:02 +00:00
|
|
|
SRC_SCSIMON = \
|
|
|
|
scsimon.cpp \
|
|
|
|
scsi.cpp \
|
|
|
|
disk.cpp \
|
|
|
|
gpiobus.cpp \
|
|
|
|
ctapdriver.cpp \
|
|
|
|
cfilesystem.cpp \
|
|
|
|
filepath.cpp \
|
|
|
|
fileio.cpp \
|
|
|
|
scsimondev.cpp
|
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
OBJ_RASCSI := $(SRC_RASCSI:%.cpp=%.o)
|
|
|
|
OBJ_RASCTL := $(SRC_RASCTL:%.cpp=%.o)
|
|
|
|
OBJ_RASDUMP := $(SRC_RASDUMP:%.cpp=%.o)
|
|
|
|
OBJ_SASIDUMP := $(SRC_SASIDUMP:%.cpp=%.o)
|
2020-07-07 19:16:02 +00:00
|
|
|
OBJ_SCSIMON := $(SRC_SCSIMON:%.cpp=%.o)
|
|
|
|
OBJ_ALL := $(OBJ_RASCSI) $(OBJ_RASCTL) $(OBJ_RASDUMP) $(OBJ_SASIDUMP) $(OBJ_SCSIMON)
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
2018-05-03 13:47:57 +00:00
|
|
|
|
|
|
|
ALL: $(BIN_ALL)
|
2020-07-07 19:16:02 +00:00
|
|
|
all: $(BIN_ALL)
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
$(RASCSI): $(OBJ_RASCSI)
|
2018-05-03 13:47:57 +00:00
|
|
|
$(CXX) -o $@ $(OBJ_RASCSI) -lpthread
|
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
$(RASCTL): $(OBJ_RASCTL)
|
2018-05-03 13:47:57 +00:00
|
|
|
$(CXX) -o $@ $(OBJ_RASCTL)
|
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
$(RASDUMP): $(OBJ_RASDUMP)
|
2018-05-03 13:47:57 +00:00
|
|
|
$(CXX) -o $@ $(OBJ_RASDUMP)
|
|
|
|
|
2020-07-04 14:57:44 +00:00
|
|
|
$(SASIDUMP): $(OBJ_SASIDUMP)
|
|
|
|
$(CXX) -o $@ $(OBJ_SASIDUMP)
|
|
|
|
|
2020-07-07 19:16:02 +00:00
|
|
|
$(SCSIMON): $(OBJ_SCSIMON)
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $(OBJ_SCSIMON) -lpthread
|
|
|
|
|
2018-05-03 13:47:57 +00:00
|
|
|
clean:
|
2020-07-04 14:57:44 +00:00
|
|
|
rm -f $(OBJ_ALL) $(BIN_ALL)
|
2020-07-07 00:23:54 +00:00
|
|
|
|
|
|
|
run:
|
|
|
|
sudo ./$(RASCSI) -ID1 /home/pi/HARDDISK.HDA -ID6 /home/pi/marathon.iso
|
2020-07-07 19:16:02 +00:00
|
|
|
|
|
|
|
.PHONY: Debug
|
|
|
|
Debug: scsimon
|