From 3020705012347b67880de0c7cc868f4f583cdb69 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 16 Oct 2024 01:12:35 +0200 Subject: [PATCH] Modularise imagewriter. --- build.py | 25 ++----------------------- lib/fluxsink/build.py | 2 +- lib/fluxsource/build.py | 2 +- lib/imagereader/build.py | 21 +++++++++++++++++++++ lib/imagewriter/build.py | 20 ++++++++++++++++++++ lib/imagewriter/nsiimagewriter.cc | 2 -- lib/imagewriter/rawimagewriter.cc | 3 +-- 7 files changed, 46 insertions(+), 29 deletions(-) diff --git a/build.py b/build.py index 15599b0f..608be99d 100644 --- a/build.py +++ b/build.py @@ -26,27 +26,6 @@ "./lib/decoders/fluxdecoder.cc", "./lib/decoders/fmmfm.cc", "./lib/encoders/encoders.cc", - "./lib/imagereader/d64imagereader.cc", - "./lib/imagereader/d88imagereader.cc", - "./lib/imagereader/dimimagereader.cc", - "./lib/imagereader/diskcopyimagereader.cc", - "./lib/imagereader/fdiimagereader.cc", - "./lib/imagereader/imagereader.cc", - "./lib/imagereader/imdimagereader.cc", - "./lib/imagereader/imgimagereader.cc", - "./lib/imagereader/jv3imagereader.cc", - "./lib/imagereader/nfdimagereader.cc", - "./lib/imagereader/nsiimagereader.cc", - "./lib/imagereader/td0imagereader.cc", - "./lib/imagewriter/d64imagewriter.cc", - "./lib/imagewriter/d88imagewriter.cc", - "./lib/imagewriter/diskcopyimagewriter.cc", - "./lib/imagewriter/imagewriter.cc", - "./lib/imagewriter/imdimagewriter.cc", - "./lib/imagewriter/imgimagewriter.cc", - "./lib/imagewriter/ldbsimagewriter.cc", - "./lib/imagewriter/nsiimagewriter.cc", - "./lib/imagewriter/rawimagewriter.cc", "./lib/readerwriter.cc", "./arch/aeslanier/decoder.cc", "./arch/agat/agat.cc", @@ -114,8 +93,6 @@ "lib/decoders/fluxdecoder.h": "./lib/decoders/fluxdecoder.h", "lib/decoders/rawbits.h": "./lib/decoders/rawbits.h", "lib/encoders/encoders.h": "./lib/encoders/encoders.h", - "lib/imagereader/imagereader.h": "./lib/imagereader/imagereader.h", - "lib/imagewriter/imagewriter.h": "./lib/imagewriter/imagewriter.h", "lib/readerwriter.h": "./lib/readerwriter.h", }, deps=[ @@ -133,6 +110,8 @@ "lib/external", "lib/fluxsink", "lib/fluxsource", + "lib/imagereader", + "lib/imagewriter", ], ) diff --git a/lib/fluxsink/build.py b/lib/fluxsink/build.py index ffaed467..a5b8d375 100644 --- a/lib/fluxsink/build.py +++ b/lib/fluxsink/build.py @@ -16,5 +16,5 @@ "./vcdfluxsink.cc", ], hdrs={"lib/fluxsink/fluxsink.h": "./fluxsink.h"}, - deps=["lib/core", "lib/config", "lib/data", "lib/external","lib/usb"], + deps=["lib/core", "lib/config", "lib/data", "lib/external", "lib/usb"], ) diff --git a/lib/fluxsource/build.py b/lib/fluxsource/build.py index f32409d5..fa9e660f 100644 --- a/lib/fluxsource/build.py +++ b/lib/fluxsource/build.py @@ -26,5 +26,5 @@ "./testpatternfluxsource.cc", ], hdrs={"lib/fluxsource/fluxsource.h": "./fluxsource.h"}, - deps=["lib/core","lib/data","lib/external","lib/usb",".+proto_lib"] + deps=["lib/core", "lib/data", "lib/external", "lib/usb", ".+proto_lib"], ) diff --git a/lib/imagereader/build.py b/lib/imagereader/build.py index babddb94..ce265703 100644 --- a/lib/imagereader/build.py +++ b/lib/imagereader/build.py @@ -1,4 +1,5 @@ from build.protobuf import proto, protocc +from build.c import cxxlibrary proto( name="proto", @@ -10,3 +11,23 @@ srcs=[".+proto"], deps=["lib+common_proto_lib"], ) + +cxxlibrary( + name="imagereader", + srcs=[ + "./d64imagereader.cc", + "./d88imagereader.cc", + "./dimimagereader.cc", + "./diskcopyimagereader.cc", + "./fdiimagereader.cc", + "./imagereader.cc", + "./imdimagereader.cc", + "./imgimagereader.cc", + "./jv3imagereader.cc", + "./nfdimagereader.cc", + "./nsiimagereader.cc", + "./td0imagereader.cc", + ], + hdrs={"lib/imagereader/imagereader.h": "./imagereader.h"}, + deps=["lib/core", "lib/config", "lib/data", ".+proto_lib"], +) diff --git a/lib/imagewriter/build.py b/lib/imagewriter/build.py index 67876025..3adf3292 100644 --- a/lib/imagewriter/build.py +++ b/lib/imagewriter/build.py @@ -1,4 +1,5 @@ from build.protobuf import proto, protocc +from build.c import cxxlibrary proto( name="proto", @@ -10,3 +11,22 @@ srcs=[".+proto"], deps=["lib+common_proto_lib", "lib/imagereader+proto_lib"], ) + +cxxlibrary( + name="imagewriter", + srcs=[ + "./d64imagewriter.cc", + "./d88imagewriter.cc", + "./diskcopyimagewriter.cc", + "./imagewriter.cc", + "./imdimagewriter.cc", + "./imgimagewriter.cc", + "./ldbsimagewriter.cc", + "./nsiimagewriter.cc", + "./rawimagewriter.cc", + ], + hdrs={ + "lib/imagewriter/imagewriter.h": "./imagewriter.h", + }, + deps=["lib/core", "lib/data", "lib/external", ".+proto_lib"], +) diff --git a/lib/imagewriter/nsiimagewriter.cc b/lib/imagewriter/nsiimagewriter.cc index 93ddf706..038cfbe2 100644 --- a/lib/imagewriter/nsiimagewriter.cc +++ b/lib/imagewriter/nsiimagewriter.cc @@ -2,10 +2,8 @@ #include "lib/config/flags.h" #include "lib/data/sector.h" #include "lib/imagewriter/imagewriter.h" -#include "lib/decoders/decoders.h" #include "lib/data/image.h" #include "lib/core/logger.h" -#include "arch/northstar/northstar.h" #include "lib/imagewriter/imagewriter.pb.h" #include #include diff --git a/lib/imagewriter/rawimagewriter.cc b/lib/imagewriter/rawimagewriter.cc index d32623ae..f7a9c5a5 100644 --- a/lib/imagewriter/rawimagewriter.cc +++ b/lib/imagewriter/rawimagewriter.cc @@ -2,10 +2,9 @@ #include "lib/config/flags.h" #include "lib/data/sector.h" #include "lib/imagewriter/imagewriter.h" -#include "lib/decoders/decoders.h" #include "lib/data/image.h" +#include "lib/data/flux.h" #include "lib/core/logger.h" -#include "arch/northstar/northstar.h" #include "lib/imagewriter/imagewriter.pb.h" #include #include