Skip to content

Commit 06e2914

Browse files
committed
Arch files are now built as one library per subdirectory, and everything
is autodetected.
1 parent 15a69f6 commit 06e2914

File tree

4 files changed

+47
-92
lines changed

4 files changed

+47
-92
lines changed

arch/arch.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "arch/rolandd20/rolandd20.h"
1919
#include "arch/smaky6/smaky6.h"
2020
#include "arch/tartu/tartu.h"
21-
#include "arch/tids990/tids990"
21+
#include "arch/tids990/tids990.h"
2222
#include "arch/victor9k/victor9k.h"
2323
#include "arch/zilogmcz/zilogmcz.h"
2424
#include "arch/arch.h"

arch/build.py

Lines changed: 44 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,61 @@
11
from build.c import cxxlibrary
22
from build.protobuf import proto, protocc
3+
from os.path import *
4+
from glob import glob
5+
import sys
6+
7+
archs = [f for f in glob("*", root_dir="arch") if isfile(f"arch/{f}/{f}.proto")]
8+
9+
ps = []
10+
pls = []
11+
cls = []
12+
for a in archs:
13+
ps += [
14+
proto(
15+
name=f"proto_{a}",
16+
srcs=[f"arch/{a}/{a}.proto"],
17+
deps=["lib/config+common_proto"],
18+
)
19+
]
20+
21+
pls += [
22+
protocc(
23+
name=f"proto_lib_{a}",
24+
srcs=[f".+proto_{a}"],
25+
deps=["lib/config+common_proto_lib"],
26+
)
27+
]
28+
29+
cls += [
30+
cxxlibrary(
31+
name=f"arch_{a}",
32+
srcs=glob(f"arch/{a}/*.cc") + glob(f"arch/{a}/*.h"),
33+
hdrs={f"arch/{a}/{a}.h": f"arch/{a}/{a}.h"},
34+
deps=[
35+
"lib/core",
36+
"lib/data",
37+
"lib/config",
38+
"lib/encoders",
39+
"lib/decoders",
40+
],
41+
)
42+
]
343

444
proto(
545
name="proto",
6-
srcs=[
7-
"./aeslanier/aeslanier.proto",
8-
"./agat/agat.proto",
9-
"./amiga/amiga.proto",
10-
"./apple2/apple2.proto",
11-
"./brother/brother.proto",
12-
"./c64/c64.proto",
13-
"./f85/f85.proto",
14-
"./fb100/fb100.proto",
15-
"./ibm/ibm.proto",
16-
"./macintosh/macintosh.proto",
17-
"./micropolis/micropolis.proto",
18-
"./mx/mx.proto",
19-
"./northstar/northstar.proto",
20-
"./rolandd20/rolandd20.proto",
21-
"./smaky6/smaky6.proto",
22-
"./tartu/tartu.proto",
23-
"./tids990/tids990.proto",
24-
"./victor9k/victor9k.proto",
25-
"./zilogmcz/zilogmcz.proto",
26-
],
27-
deps=["lib/config+common_proto"],
46+
deps=ps + ["lib/config+common_proto"],
2847
)
2948

30-
protocc(
31-
name="proto_lib", srcs=[".+proto"], deps=["lib/config+common_proto_lib"]
32-
)
49+
cxxlibrary(name="proto_lib", deps=pls)
3350

3451
cxxlibrary(
3552
name="arch",
3653
srcs=[
3754
"./arch.cc",
38-
"./aeslanier/decoder.cc",
39-
"./agat/agat.cc",
40-
"./agat/decoder.cc",
41-
"./agat/encoder.cc",
42-
"./amiga/amiga.cc",
43-
"./amiga/decoder.cc",
44-
"./amiga/encoder.cc",
45-
"./apple2/decoder.cc",
46-
"./apple2/encoder.cc",
47-
"./brother/decoder.cc",
48-
"./brother/encoder.cc",
49-
"./brother/header_gcr.h",
50-
"./c64/c64.cc",
51-
"./c64/decoder.cc",
52-
"./c64/encoder.cc",
53-
"./f85/decoder.cc",
54-
"./fb100/decoder.cc",
55-
"./ibm/decoder.cc",
56-
"./ibm/encoder.cc",
57-
"./macintosh/decoder.cc",
58-
"./macintosh/encoder.cc",
59-
"./macintosh/data_gcr.h",
60-
"./micropolis/decoder.cc",
61-
"./micropolis/encoder.cc",
62-
"./mx/decoder.cc",
63-
"./northstar/decoder.cc",
64-
"./northstar/encoder.cc",
65-
"./rolandd20/decoder.cc",
66-
"./smaky6/decoder.cc",
67-
"./tartu/decoder.cc",
68-
"./tartu/encoder.cc",
69-
"./tids990/decoder.cc",
70-
"./tids990/encoder.cc",
71-
"./victor9k/decoder.cc",
72-
"./victor9k/encoder.cc",
73-
"./zilogmcz/decoder.cc",
7455
],
7556
hdrs={
76-
"arch/ibm/ibm.h": "./ibm/ibm.h",
77-
"arch/apple2/data_gcr.h": "./apple2/data_gcr.h",
78-
"arch/apple2/apple2.h": "./apple2/apple2.h",
79-
"arch/amiga/amiga.h": "./amiga/amiga.h",
80-
"arch/smaky6/smaky6.h": "./smaky6/smaky6.h",
81-
"arch/tids990/tids990": "./tids990/tids990.h",
82-
"arch/zilogmcz/zilogmcz.h": "./zilogmcz/zilogmcz.h",
83-
"arch/amiga/amiga.h": "./amiga/amiga.h",
84-
"arch/f85/data_gcr.h": "./f85/data_gcr.h",
85-
"arch/f85/f85.h": "./f85/f85.h",
86-
"arch/mx/mx.h": "./mx/mx.h",
87-
"arch/aeslanier/aeslanier.h": "./aeslanier/aeslanier.h",
88-
"arch/northstar/northstar.h": "./northstar/northstar.h",
89-
"arch/brother/data_gcr.h": "./brother/data_gcr.h",
90-
"arch/brother/brother.h": "./brother/brother.h",
91-
"arch/brother/header_gcr.h": "./brother/header_gcr.h",
92-
"arch/macintosh/data_gcr.h": "./macintosh/data_gcr.h",
93-
"arch/macintosh/macintosh.h": "./macintosh/macintosh.h",
94-
"arch/agat/agat.h": "./agat/agat.h",
95-
"arch/fb100/fb100.h": "./fb100/fb100.h",
96-
"arch/victor9k/data_gcr.h": "./victor9k/data_gcr.h",
97-
"arch/victor9k/victor9k.h": "./victor9k/victor9k.h",
98-
"arch/rolandd20/rolandd20.h": "./rolandd20/rolandd20.h",
99-
"arch/micropolis/micropolis.h": "./micropolis/micropolis.h",
100-
"arch/c64/data_gcr.h": "./c64/data_gcr.h",
101-
"arch/c64/c64.h": "./c64/c64.h",
102-
"arch/tartu/tartu.h": "./tartu/tartu.h",
10357
"arch/arch.h": "./arch.h",
10458
},
105-
deps=["lib/core", "lib/data", "lib/config", "lib/encoders", "lib/decoders"],
59+
deps=cls
60+
+ ["lib/core", "lib/data", "lib/config", "lib/encoders", "lib/decoders"],
10661
)

arch/tids990/decoder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "lib/core/globals.h"
22
#include "lib/decoders/decoders.h"
33
#include "lib/encoders/encoders.h"
4-
#include "arch/tids990/tids990"
4+
#include "arch/tids990/tids990.h"
55
#include "lib/core/crc.h"
66
#include "lib/data/fluxmap.h"
77
#include "lib/data/fluxmapreader.h"

arch/tids990/encoder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "lib/core/globals.h"
22
#include "lib/decoders/decoders.h"
33
#include "lib/encoders/encoders.h"
4-
#include "arch/tids990/tids990"
4+
#include "arch/tids990/tids990.h"
55
#include "lib/core/crc.h"
66
#include "lib/data/image.h"
77
#include "arch/tids990/tids990.pb.h"

0 commit comments

Comments
 (0)