-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmakefile
More file actions
398 lines (349 loc) · 28.5 KB
/
Copy pathmakefile
File metadata and controls
398 lines (349 loc) · 28.5 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
#
# makefile
#
# Build with Homebrew GCC (gcc-16), not Apple clang's `gcc` shim. gcc-16 is the
# reference toolchain (matches the Apple Silicon dev box); it is stricter and
# surfaces warnings clang hides. On Apple Silicon it is /opt/homebrew/bin/gcc-16,
# on Intel /usr/local/bin/gcc-16 -- both on PATH as `gcc-16`. `brew install gcc`.
CC=gcc-16 -Wall -O3 -funroll-loops -pthread
# CC=gcc-16 -Wall -lm -g -O0
# Sources live under src/<cipher-class>/. All local #includes are flat
# (#include "foo.h"), so the compiler finds every header via these -I paths
# regardless of which subdirectory it lives in.
SRC=src
INCLUDES=-I$(SRC)/core -I$(SRC)/polyalphabetic -I$(SRC)/transposition -I$(SRC)/polygraphic -I$(SRC)/substitution
CORE=$(SRC)/core
POLY=$(SRC)/polyalphabetic
TRANS=$(SRC)/transposition
GRAPH=$(SRC)/polygraphic
SUBST=$(SRC)/substitution
# Cipher primitives (decrypt math, shared by the solvers and the unit tests).
PRIMITIVES=$(CORE)/utils.c $(CORE)/parse.c $(CORE)/dict.c $(CORE)/spaces.c $(TRANS)/transpositions.c $(TRANS)/period_column.c $(CORE)/perioc.c $(POLY)/quagmire.c $(POLY)/vigenere.c $(POLY)/gronsfeld.c $(POLY)/gromark.c $(POLY)/nicodemus.c $(POLY)/porta.c $(POLY)/beaufort.c $(POLY)/autokey.c $(CORE)/optimal_cycleword.c $(GRAPH)/playfair.c $(GRAPH)/bifid.c $(GRAPH)/trifid.c $(GRAPH)/hill.c $(GRAPH)/phillips.c $(GRAPH)/twosquare.c $(GRAPH)/foursquare.c $(GRAPH)/adfgvx.c $(GRAPH)/nihilist_sub.c $(GRAPH)/bazeries.c $(GRAPH)/portax.c $(POLY)/progkey.c $(GRAPH)/slidefair.c $(GRAPH)/seriated_playfair.c $(GRAPH)/digrafid.c $(GRAPH)/cm_bifid.c $(GRAPH)/trisquare.c $(POLY)/intkey.c $(POLY)/condi.c $(GRAPH)/fracmorse.c $(GRAPH)/pollux.c $(GRAPH)/morbit.c $(GRAPH)/straddling_checkerboard.c $(GRAPH)/monome_dinome.c $(GRAPH)/tridigital.c $(GRAPH)/checkerboard.c $(TRANS)/sequence_transposition.c $(GRAPH)/grandpre.c $(GRAPH)/syllabary.c $(SUBST)/ragbaby.c $(SUBST)/aristocrat.c
# Cipher-agnostic core + per-cipher-type solver modules (split out of colossus.c).
SOLVERS=$(CORE)/engine.c $(CORE)/scoring.c $(TRANS)/trans_common.c $(POLY)/polyalpha_solver.c $(POLY)/gromark_solver.c $(POLY)/nicodemus_solver.c $(TRANS)/transmatrix_solver.c $(TRANS)/permutation_solver.c $(TRANS)/columnar_solver.c $(TRANS)/columnar_track_solver.c $(TRANS)/route_chain_solver.c $(TRANS)/tile_solver.c $(TRANS)/period_column_solver.c $(TRANS)/period_column_space_solver.c $(TRANS)/double_transposition_solver.c $(TRANS)/railfence_solver.c $(TRANS)/route_solver.c $(TRANS)/amsco_solver.c $(TRANS)/myszkowski_solver.c $(TRANS)/redefence_solver.c $(TRANS)/cadenus_solver.c $(TRANS)/nihilist_solver.c $(TRANS)/swagman_solver.c $(TRANS)/grille_solver.c $(SUBST)/indep_solver.c $(SUBST)/homophonic_solver.c $(GRAPH)/playfair_solver.c $(GRAPH)/bifid_solver.c $(GRAPH)/trifid_solver.c $(GRAPH)/hill_solver.c $(GRAPH)/phillips_solver.c $(GRAPH)/twosquare_solver.c $(GRAPH)/foursquare_solver.c $(GRAPH)/adfgvx_solver.c $(GRAPH)/nihilist_sub_solver.c $(GRAPH)/bazeries_solver.c $(GRAPH)/portax_solver.c $(POLY)/progkey_solver.c $(GRAPH)/slidefair_solver.c $(GRAPH)/seriated_playfair_solver.c $(GRAPH)/digrafid_solver.c $(GRAPH)/cm_bifid_solver.c $(GRAPH)/trisquare_solver.c $(POLY)/intkey_solver.c $(POLY)/condi_solver.c $(GRAPH)/fracmorse_solver.c $(GRAPH)/pollux_solver.c $(GRAPH)/morbit_solver.c $(GRAPH)/straddling_checkerboard_solver.c $(GRAPH)/monome_dinome_solver.c $(GRAPH)/tridigital_solver.c $(GRAPH)/checkerboard_solver.c $(TRANS)/sequence_transposition_solver.c $(GRAPH)/grandpre_solver.c $(GRAPH)/syllabary_solver.c $(SUBST)/ragbaby_solver.c $(SUBST)/aristocrat_solver.c
# The full solver translation-unit set (everything but the test harnesses).
SOLVER_SRC=$(PRIMITIVES) $(SOLVERS) $(CORE)/colossus.c
all:
$(CC) $(INCLUDES) $(SOLVER_SRC) -o colossus
cp colossus ..
cp colossus ../quagmire
# Fast unit tests of the primitives (sub-second). Add -lm on Linux.
# test_transpositions : the transposition primitives (transpositions.c)
# test_ciphers : the cipher primitives (vigenere/beaufort/porta/quagmire/autokey)
# test_optimal_cycleword : deterministic optimal-cycleword recovery
# test_playfair : the Playfair primitives (grid build / encrypt / decrypt / prepare)
test:
$(CC) $(INCLUDES) tests/test_transpositions.c $(CORE)/utils.c $(TRANS)/transpositions.c -o tests/test_transpositions
./tests/test_transpositions
$(CC) $(INCLUDES) tests/test_ciphers.c $(CORE)/utils.c $(POLY)/quagmire.c $(POLY)/vigenere.c $(POLY)/porta.c $(POLY)/beaufort.c $(POLY)/autokey.c -o tests/test_ciphers
./tests/test_ciphers
$(CC) $(INCLUDES) tests/test_gronsfeld.c $(CORE)/utils.c $(POLY)/gronsfeld.c $(POLY)/vigenere.c $(POLY)/quagmire.c -o tests/test_gronsfeld
./tests/test_gronsfeld
$(CC) $(INCLUDES) tests/test_optimal_cycleword.c $(CORE)/utils.c $(POLY)/quagmire.c $(POLY)/vigenere.c $(POLY)/porta.c $(POLY)/beaufort.c $(CORE)/optimal_cycleword.c -o tests/test_optimal_cycleword
./tests/test_optimal_cycleword
$(CC) $(INCLUDES) tests/test_held_karp.c $(TRANS)/trans_common.c $(CORE)/scoring.c $(CORE)/utils.c $(CORE)/dict.c $(CORE)/spaces.c -o tests/test_held_karp
./tests/test_held_karp
$(CC) $(INCLUDES) tests/test_playfair.c $(CORE)/utils.c $(GRAPH)/playfair.c -o tests/test_playfair
./tests/test_playfair
$(CC) $(INCLUDES) tests/test_bifid.c $(CORE)/utils.c $(GRAPH)/bifid.c -o tests/test_bifid
./tests/test_bifid
$(CC) $(INCLUDES) tests/test_trifid.c $(CORE)/utils.c $(GRAPH)/trifid.c -o tests/test_trifid
./tests/test_trifid
$(CC) $(INCLUDES) tests/test_hill.c $(CORE)/utils.c $(GRAPH)/hill.c -o tests/test_hill
./tests/test_hill
$(CC) $(INCLUDES) tests/test_phillips.c $(CORE)/utils.c $(GRAPH)/phillips.c -o tests/test_phillips
./tests/test_phillips
$(CC) $(INCLUDES) tests/test_twosquare.c $(CORE)/utils.c $(GRAPH)/twosquare.c $(GRAPH)/playfair.c -o tests/test_twosquare
./tests/test_twosquare
$(CC) $(INCLUDES) tests/test_foursquare.c $(CORE)/utils.c $(GRAPH)/foursquare.c -o tests/test_foursquare
./tests/test_foursquare
$(CC) $(INCLUDES) tests/test_trisquare.c $(CORE)/utils.c $(GRAPH)/trisquare.c $(GRAPH)/bifid.c -o tests/test_trisquare
./tests/test_trisquare
$(CC) $(INCLUDES) tests/test_adfgvx.c $(CORE)/utils.c $(GRAPH)/adfgvx.c $(GRAPH)/bifid.c $(TRANS)/transpositions.c -o tests/test_adfgvx
./tests/test_adfgvx
$(CC) $(INCLUDES) tests/test_nihilist_sub.c $(CORE)/utils.c $(GRAPH)/nihilist_sub.c -o tests/test_nihilist_sub
./tests/test_nihilist_sub
$(CC) $(INCLUDES) tests/test_gromark.c $(CORE)/utils.c $(POLY)/gromark.c -o tests/test_gromark
./tests/test_gromark
$(CC) $(INCLUDES) tests/test_nicodemus.c $(CORE)/utils.c $(POLY)/nicodemus.c $(POLY)/quagmire.c $(POLY)/vigenere.c $(POLY)/beaufort.c -o tests/test_nicodemus
./tests/test_nicodemus
$(CC) $(INCLUDES) tests/test_bazeries.c $(CORE)/utils.c $(GRAPH)/bazeries.c $(GRAPH)/bifid.c -o tests/test_bazeries
./tests/test_bazeries
$(CC) $(INCLUDES) tests/test_portax.c $(CORE)/utils.c $(GRAPH)/portax.c -o tests/test_portax
./tests/test_portax
$(CC) $(INCLUDES) tests/test_progkey.c $(CORE)/utils.c $(POLY)/progkey.c $(POLY)/vigenere.c $(POLY)/beaufort.c $(POLY)/quagmire.c -o tests/test_progkey
./tests/test_progkey
$(CC) $(INCLUDES) tests/test_intkey.c $(CORE)/utils.c $(POLY)/intkey.c $(POLY)/vigenere.c $(POLY)/beaufort.c $(POLY)/quagmire.c -o tests/test_intkey
./tests/test_intkey
$(CC) $(INCLUDES) tests/test_condi.c $(CORE)/utils.c $(POLY)/condi.c -o tests/test_condi
./tests/test_condi
$(CC) $(INCLUDES) tests/test_slidefair.c $(CORE)/utils.c $(GRAPH)/slidefair.c -o tests/test_slidefair
./tests/test_slidefair
$(CC) $(INCLUDES) tests/test_seriated_playfair.c $(CORE)/utils.c $(GRAPH)/seriated_playfair.c $(GRAPH)/playfair.c -o tests/test_seriated_playfair
./tests/test_seriated_playfair
$(CC) $(INCLUDES) tests/test_digrafid.c $(CORE)/utils.c $(GRAPH)/digrafid.c $(GRAPH)/bifid.c -o tests/test_digrafid
./tests/test_digrafid
$(CC) $(INCLUDES) tests/test_cm_bifid.c $(CORE)/utils.c $(GRAPH)/cm_bifid.c $(GRAPH)/bifid.c -o tests/test_cm_bifid
./tests/test_cm_bifid
$(CC) $(INCLUDES) tests/test_fracmorse.c $(CORE)/utils.c $(GRAPH)/fracmorse.c -o tests/test_fracmorse
./tests/test_fracmorse
$(CC) $(INCLUDES) tests/test_period_column.c $(CORE)/utils.c $(TRANS)/period_column.c -o tests/test_period_column
./tests/test_period_column
$(CC) $(INCLUDES) tests/test_pollux.c $(CORE)/utils.c $(GRAPH)/pollux.c -o tests/test_pollux
./tests/test_pollux
$(CC) $(INCLUDES) tests/test_morbit.c $(CORE)/utils.c $(GRAPH)/morbit.c -o tests/test_morbit
./tests/test_morbit
$(CC) $(INCLUDES) tests/test_straddling_checkerboard.c $(CORE)/utils.c $(GRAPH)/straddling_checkerboard.c -o tests/test_straddling_checkerboard
./tests/test_straddling_checkerboard
$(CC) $(INCLUDES) tests/test_monome_dinome.c $(CORE)/utils.c $(GRAPH)/monome_dinome.c -o tests/test_monome_dinome
./tests/test_monome_dinome
$(CC) $(INCLUDES) tests/test_tridigital.c $(CORE)/utils.c $(GRAPH)/tridigital.c -o tests/test_tridigital
./tests/test_tridigital
$(CC) $(INCLUDES) tests/test_checkerboard.c $(CORE)/utils.c $(GRAPH)/checkerboard.c $(GRAPH)/bifid.c -o tests/test_checkerboard
./tests/test_checkerboard
$(CC) $(INCLUDES) tests/test_ragbaby.c $(CORE)/utils.c $(SUBST)/ragbaby.c -o tests/test_ragbaby
./tests/test_ragbaby
$(CC) $(INCLUDES) tests/test_aristocrat.c $(CORE)/utils.c $(SUBST)/aristocrat.c -o tests/test_aristocrat
./tests/test_aristocrat
$(CC) $(INCLUDES) tests/test_sequence_transposition.c $(CORE)/utils.c $(TRANS)/sequence_transposition.c $(POLY)/gromark.c -o tests/test_sequence_transposition
./tests/test_sequence_transposition
$(CC) $(INCLUDES) tests/test_grandpre.c $(CORE)/utils.c $(GRAPH)/grandpre.c -o tests/test_grandpre
./tests/test_grandpre
$(CC) $(INCLUDES) tests/test_syllabary.c $(CORE)/utils.c $(GRAPH)/syllabary.c -o tests/test_syllabary
./tests/test_syllabary
$(CC) $(INCLUDES) tests/test_double_transposition.c $(TRANS)/double_transposition_solver.c $(TRANS)/transpositions.c $(CORE)/scoring.c $(CORE)/utils.c $(CORE)/dict.c $(CORE)/spaces.c -o tests/test_double_transposition
./tests/test_double_transposition
# Slow optimizer regression suite (~30s): planted-cipher recovery through the
# full solve_cipher hill climber at fixed seeds and budgets. Kept separate from
# `make test` so the fast primitive checks stay in the quick edit/build loop.
testopt:
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_solver.c $(SOLVER_SRC) -o tests/test_solver
./tests/test_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_gronsfeld_solver.c $(SOLVER_SRC) -o tests/test_gronsfeld_solver
./tests/test_gronsfeld_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_playfair_solver.c $(SOLVER_SRC) -o tests/test_playfair_solver
./tests/test_playfair_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_bifid_solver.c $(SOLVER_SRC) -o tests/test_bifid_solver
./tests/test_bifid_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_trifid_solver.c $(SOLVER_SRC) -o tests/test_trifid_solver
./tests/test_trifid_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_hill_solver.c $(SOLVER_SRC) -o tests/test_hill_solver
./tests/test_hill_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_phillips_solver.c $(SOLVER_SRC) -o tests/test_phillips_solver
./tests/test_phillips_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_twosquare_solver.c $(SOLVER_SRC) -o tests/test_twosquare_solver
./tests/test_twosquare_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_foursquare_solver.c $(SOLVER_SRC) -o tests/test_foursquare_solver
./tests/test_foursquare_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_trisquare_solver.c $(SOLVER_SRC) -o tests/test_trisquare_solver
./tests/test_trisquare_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_adfgvx_solver.c $(SOLVER_SRC) -o tests/test_adfgvx_solver
./tests/test_adfgvx_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_nihilist_sub_solver.c $(SOLVER_SRC) -o tests/test_nihilist_sub_solver
./tests/test_nihilist_sub_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_gromark_solver.c $(SOLVER_SRC) -o tests/test_gromark_solver
./tests/test_gromark_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_nicodemus_solver.c $(SOLVER_SRC) -o tests/test_nicodemus_solver
./tests/test_nicodemus_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_bazeries_solver.c $(SOLVER_SRC) -o tests/test_bazeries_solver
./tests/test_bazeries_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_portax_solver.c $(SOLVER_SRC) -o tests/test_portax_solver
./tests/test_portax_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_progkey_solver.c $(SOLVER_SRC) -o tests/test_progkey_solver
./tests/test_progkey_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_intkey_solver.c $(SOLVER_SRC) -o tests/test_intkey_solver
./tests/test_intkey_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_condi_solver.c $(SOLVER_SRC) -o tests/test_condi_solver
./tests/test_condi_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_slidefair_solver.c $(SOLVER_SRC) -o tests/test_slidefair_solver
./tests/test_slidefair_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_seriated_playfair_solver.c $(SOLVER_SRC) -o tests/test_seriated_playfair_solver
./tests/test_seriated_playfair_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_digrafid_solver.c $(SOLVER_SRC) -o tests/test_digrafid_solver
./tests/test_digrafid_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_cm_bifid_solver.c $(SOLVER_SRC) -o tests/test_cm_bifid_solver
./tests/test_cm_bifid_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_fracmorse_solver.c $(SOLVER_SRC) -o tests/test_fracmorse_solver
./tests/test_fracmorse_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_period_column_solver.c $(SOLVER_SRC) -o tests/test_period_column_solver
./tests/test_period_column_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_period_column_space_solver.c $(SOLVER_SRC) -o tests/test_period_column_space_solver
./tests/test_period_column_space_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_double_transposition_solver.c $(SOLVER_SRC) -o tests/test_double_transposition_solver
./tests/test_double_transposition_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_pollux_solver.c $(SOLVER_SRC) -o tests/test_pollux_solver
./tests/test_pollux_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_morbit_solver.c $(SOLVER_SRC) -o tests/test_morbit_solver
./tests/test_morbit_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_straddling_checkerboard_solver.c $(SOLVER_SRC) -o tests/test_straddling_checkerboard_solver
./tests/test_straddling_checkerboard_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_monome_dinome_solver.c $(SOLVER_SRC) -o tests/test_monome_dinome_solver
./tests/test_monome_dinome_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_tridigital_solver.c $(SOLVER_SRC) -o tests/test_tridigital_solver
./tests/test_tridigital_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_checkerboard_solver.c $(SOLVER_SRC) -o tests/test_checkerboard_solver
./tests/test_checkerboard_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_ragbaby_solver.c $(SOLVER_SRC) -o tests/test_ragbaby_solver
./tests/test_ragbaby_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_aristocrat_solver.c $(SOLVER_SRC) -o tests/test_aristocrat_solver
./tests/test_aristocrat_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_sequence_transposition_solver.c $(SOLVER_SRC) -o tests/test_sequence_transposition_solver
./tests/test_sequence_transposition_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_grandpre_solver.c $(SOLVER_SRC) -o tests/test_grandpre_solver
./tests/test_grandpre_solver
$(CC) $(INCLUDES) -DCOLOSSUS_NO_MAIN tests/test_syllabary_solver.c $(SOLVER_SRC) -o tests/test_syllabary_solver
./tests/test_syllabary_solver
# Everything.
testall: test testopt
# Standalone test-data generator for homophonic ciphers (not part of the solver
# build). Emits a comma-separated homophonic ciphertext + its plaintext solution;
# used to mint ciphers/tests/homophonic_test.*.
homophonic_gen:
$(CC) $(INCLUDES) tools/homophonic_gen.c -o tools/homophonic_gen
# Standalone test-data generator for Playfair ciphers. Reuses the real cipher code
# (playfair.c + utils.c) so the generator and solver can never drift in convention.
playfair_gen:
$(CC) $(INCLUDES) tools/playfair_gen.c $(GRAPH)/playfair.c $(CORE)/utils.c -o tools/playfair_gen
# Standalone test-data generator for Bifid ciphers. Reuses the real cipher code
# (bifid.c + utils.c) so the generator and solver can never drift in convention.
bifid_gen:
$(CC) $(INCLUDES) tools/bifid_gen.c $(GRAPH)/bifid.c $(CORE)/utils.c -o tools/bifid_gen
# Standalone test-data generator for Trifid ciphers. Reuses the real cipher code
# (trifid.c + utils.c) so the generator and solver can never drift in convention.
trifid_gen:
$(CC) $(INCLUDES) tools/trifid_gen.c $(GRAPH)/trifid.c $(CORE)/utils.c -o tools/trifid_gen
# Standalone test-data generator for Hill ciphers. Reuses the real cipher code
# (hill.c + utils.c) so the generator and solver can never drift in convention.
hill_gen:
$(CC) $(INCLUDES) tools/hill_gen.c $(GRAPH)/hill.c $(CORE)/utils.c -o tools/hill_gen
# Standalone test-data generator for Gronsfeld ciphers. Reuses the real cipher code
# (gronsfeld.c + utils.c) so the generator and solver can never drift in convention.
gronsfeld_gen:
$(CC) $(INCLUDES) tools/gronsfeld_gen.c $(POLY)/gronsfeld.c $(CORE)/utils.c -o tools/gronsfeld_gen
# Standalone test-data generator for Phillips ciphers. Reuses the real cipher code
# (phillips.c + utils.c) so the generator and solver can never drift in convention.
phillips_gen:
$(CC) $(INCLUDES) tools/phillips_gen.c $(GRAPH)/phillips.c $(CORE)/utils.c -o tools/phillips_gen
# Standalone test-data generators for Two-Square / Four-Square ciphers. Reuse the real
# cipher code (twosquare.c / foursquare.c + playfair.c keyword build + utils.c) so the
# generators and the solver can never drift in convention.
twosquare_gen:
$(CC) $(INCLUDES) tools/twosquare_gen.c $(GRAPH)/twosquare.c $(GRAPH)/playfair.c $(CORE)/utils.c -o tools/twosquare_gen
foursquare_gen:
$(CC) $(INCLUDES) tools/foursquare_gen.c $(GRAPH)/foursquare.c $(GRAPH)/playfair.c $(CORE)/utils.c -o tools/foursquare_gen
trisquare_gen:
$(CC) $(INCLUDES) tools/trisquare_gen.c $(GRAPH)/trisquare.c $(GRAPH)/bifid.c $(GRAPH)/playfair.c $(CORE)/utils.c -o tools/trisquare_gen
# Standalone test-data generator for ADFGVX / ADFGX ciphers. Reuses the real cipher code
# (adfgvx.c + bifid.c keyed-square build/inverse + transpositions.c columnar + utils.c)
# so the generator and the solver can never drift in convention.
adfgvx_gen:
$(CC) $(INCLUDES) tools/adfgvx_gen.c $(GRAPH)/adfgvx.c $(GRAPH)/bifid.c $(TRANS)/transpositions.c $(CORE)/utils.c -o tools/adfgvx_gen
# Standalone test-data generator for Nihilist Substitution ciphers. Reuses the real cipher
# code (nihilist_sub.c + bifid.c keyed-square build/inverse + utils.c) so the generator and
# the solver can never drift in convention.
nihilist_sub_gen:
$(CC) $(INCLUDES) tools/nihilist_sub_gen.c $(GRAPH)/nihilist_sub.c $(GRAPH)/bifid.c $(CORE)/utils.c -o tools/nihilist_sub_gen
# Standalone test-data generator for Gromark / Periodic Gromark ciphers. Reuses the real
# cipher code (gromark.c + utils.c) so the generator and the solver can never drift.
gromark_gen:
$(CC) $(INCLUDES) tools/gromark_gen.c $(POLY)/gromark.c $(CORE)/utils.c -o tools/gromark_gen
# Standalone test-data generator for Nicodemus ciphers. Reuses the real cipher code
# (nicodemus.c + utils.c) so the generator and the solver can never drift.
nicodemus_gen:
$(CC) $(INCLUDES) tools/nicodemus_gen.c $(POLY)/nicodemus.c $(CORE)/utils.c -o tools/nicodemus_gen
# Standalone test-data generator for Bazeries ciphers. Reuses the real cipher code
# (bazeries.c + bifid.c keyed-square build/inverse + utils.c) so the generator and the
# solver can never drift in convention.
bazeries_gen:
$(CC) $(INCLUDES) tools/bazeries_gen.c $(GRAPH)/bazeries.c $(GRAPH)/bifid.c $(CORE)/utils.c -o tools/bazeries_gen
# Standalone test-data generator for Portax ciphers. Reuses the real cipher code
# (portax.c + utils.c) so the generator and the solver can never drift in convention.
portax_gen:
$(CC) $(INCLUDES) tools/portax_gen.c $(GRAPH)/portax.c $(CORE)/utils.c -o tools/portax_gen
# Standalone test-data generator for Progressive Key ciphers. Reuses the real cipher code
# (progkey.c + utils.c) so the generator and the solver can never drift in convention.
progkey_gen:
$(CC) $(INCLUDES) tools/progkey_gen.c $(POLY)/progkey.c $(CORE)/utils.c -o tools/progkey_gen
intkey_gen:
$(CC) $(INCLUDES) tools/intkey_gen.c $(POLY)/intkey.c $(CORE)/utils.c -o tools/intkey_gen
condi_gen:
$(CC) $(INCLUDES) tools/condi_gen.c $(POLY)/condi.c $(CORE)/utils.c -o tools/condi_gen
# Standalone test-data generator for Slidefair ciphers. Reuses the real cipher code
# (slidefair.c + utils.c) so the generator and the solver can never drift in convention.
slidefair_gen:
$(CC) $(INCLUDES) tools/slidefair_gen.c $(GRAPH)/slidefair.c $(CORE)/utils.c -o tools/slidefair_gen
# Standalone test-data generator for Seriated Playfair ciphers. Reuses the real cipher
# code (seriated_playfair.c + playfair.c keyword/grid build + utils.c) so the generator
# and the solver can never drift in convention.
seriated_playfair_gen:
$(CC) $(INCLUDES) tools/seriated_playfair_gen.c $(GRAPH)/seriated_playfair.c $(GRAPH)/playfair.c $(CORE)/utils.c -o tools/seriated_playfair_gen
# Standalone test-data generator for Digrafid ciphers. Reuses the real cipher code
# (digrafid.c + bifid.c build-inverse + utils.c) so the generator and the solver can never
# drift in convention.
digrafid_gen:
$(CC) $(INCLUDES) tools/digrafid_gen.c $(GRAPH)/digrafid.c $(GRAPH)/bifid.c $(CORE)/utils.c -o tools/digrafid_gen
# Standalone test-data generator for CM Bifid ciphers. Reuses the real cipher code
# (cm_bifid.c + bifid.c build-inverse/keyword + utils.c) so the generator and the solver
# can never drift in convention.
cm_bifid_gen:
$(CC) $(INCLUDES) tools/cm_bifid_gen.c $(GRAPH)/cm_bifid.c $(GRAPH)/bifid.c $(CORE)/utils.c -o tools/cm_bifid_gen
# Standalone test-data generator for Fractionated Morse ciphers. Reuses the real cipher code
# (fracmorse.c + utils.c) so the generator and the solver can never drift in convention.
fracmorse_gen:
$(CC) $(INCLUDES) tools/fracmorse_gen.c $(GRAPH)/fracmorse.c $(CORE)/utils.c -o tools/fracmorse_gen
# Period column order generator (links the real primitive; carries spaces as grid cells).
period_column_gen:
$(CC) $(INCLUDES) tools/period_column_gen.c $(TRANS)/period_column.c -o tools/period_column_gen
# Standalone Pollux generator. Reuses the real primitive (pollux.c + utils.c) so the
# generator and the solver can never drift in convention.
pollux_gen:
$(CC) $(INCLUDES) tools/pollux_gen.c $(GRAPH)/pollux.c $(CORE)/utils.c -o tools/pollux_gen
# Standalone Morbit generator. Reuses the real primitive (morbit.c + utils.c) so the
# generator and the solver can never drift in convention.
morbit_gen:
$(CC) $(INCLUDES) tools/morbit_gen.c $(GRAPH)/morbit.c $(CORE)/utils.c -o tools/morbit_gen
# Standalone Straddling Checkerboard generator. Reuses the real primitive
# (straddling_checkerboard.c + utils.c) so the generator and solver never drift.
straddling_checkerboard_gen:
$(CC) $(INCLUDES) tools/straddling_checkerboard_gen.c $(GRAPH)/straddling_checkerboard.c $(CORE)/utils.c -o tools/straddling_checkerboard_gen
# Standalone Monome-Dinome generator. Reuses the real primitive (monome_dinome.c + utils.c)
# so the generator and the solver can never drift in convention.
monome_dinome_gen:
$(CC) $(INCLUDES) tools/monome_dinome_gen.c $(GRAPH)/monome_dinome.c $(CORE)/utils.c -o tools/monome_dinome_gen
# Standalone Tridigital generator. Reuses the real primitive (tridigital.c + utils.c)
# so the generator and the solver can never drift in convention.
tridigital_gen:
$(CC) $(INCLUDES) tools/tridigital_gen.c $(GRAPH)/tridigital.c $(CORE)/utils.c -o tools/tridigital_gen
# Standalone Checkerboard generator. Reuses the real primitive (checkerboard.c + bifid.c keyed-square
# build + utils.c) so the generator and the solver can never drift in convention. The complex
# (two-keyword) case's 2x2 label choice is randomized inside the primitive under a fixed seed.
checkerboard_gen:
$(CC) $(INCLUDES) tools/checkerboard_gen.c $(GRAPH)/checkerboard.c $(GRAPH)/bifid.c $(CORE)/utils.c -o tools/checkerboard_gen
# Standalone test-data generator for double columnar transposition ciphers. Reuses the
# real columnar primitive (transpositions.c) so the generator and the solver can never
# drift in convention.
double_transposition_gen:
$(CC) $(INCLUDES) tools/double_transposition_gen.c $(TRANS)/transpositions.c $(CORE)/utils.c -o tools/double_transposition_gen
# Standalone Ragbaby generator. Reuses the real primitive (ragbaby.c + utils.c) so the
# generator and the solver can never drift in convention.
ragbaby_gen:
$(CC) $(INCLUDES) tools/ragbaby_gen.c $(SUBST)/ragbaby.c $(CORE)/utils.c -o tools/ragbaby_gen
# Standalone Aristocrat / Patristocrat generator. Reuses the real primitive (aristocrat.c + utils.c)
# so the generator and the solver can never drift in convention.
aristocrat_gen:
$(CC) $(INCLUDES) tools/aristocrat_gen.c $(SUBST)/aristocrat.c $(CORE)/utils.c -o tools/aristocrat_gen
# Standalone Sequence Transposition generator. Reuses the real primitive
# (sequence_transposition.c + gromark.c chain-addition + utils.c) so the generator and the
# solver can never drift in convention.
sequence_transposition_gen:
$(CC) $(INCLUDES) tools/sequence_transposition_gen.c $(TRANS)/sequence_transposition.c $(POLY)/gromark.c $(CORE)/utils.c -o tools/sequence_transposition_gen
# Standalone Grandpre generator. Reuses the real primitive (grandpre.c + utils.c) so the
# generator and the solver can never drift. Homophone choice is random (isolog); -seed fixes it.
grandpre_gen:
$(CC) $(INCLUDES) tools/grandpre_gen.c $(GRAPH)/grandpre.c $(CORE)/utils.c -o tools/grandpre_gen
# Standalone Syllabary generator. Reuses the real primitive (syllabary.c + utils.c) so the
# generator and the solver can never drift. The square is a reproducible random scramble (-sqseed).
syllabary_gen:
$(CC) $(INCLUDES) tools/syllabary_gen.c $(GRAPH)/syllabary.c $(CORE)/utils.c -o tools/syllabary_gen
clean:
rm -f colossus tests/test_transpositions tests/test_ciphers tests/test_optimal_cycleword tests/test_held_karp tests/test_solver tests/test_playfair tests/test_playfair_solver tests/test_bifid tests/test_bifid_solver tests/test_trifid tests/test_trifid_solver tests/test_hill tests/test_hill_solver tests/test_gronsfeld tests/test_gronsfeld_solver tests/test_phillips tests/test_phillips_solver tests/test_twosquare tests/test_twosquare_solver tests/test_foursquare tests/test_foursquare_solver tests/test_adfgvx tests/test_adfgvx_solver tests/test_nihilist_sub tests/test_nihilist_sub_solver tests/test_gromark tests/test_gromark_solver tests/test_nicodemus tests/test_nicodemus_solver tests/test_bazeries tests/test_bazeries_solver tests/test_portax tests/test_portax_solver tests/test_progkey tests/test_progkey_solver tests/test_slidefair tests/test_slidefair_solver tests/test_seriated_playfair tests/test_seriated_playfair_solver tests/test_digrafid tests/test_digrafid_solver tests/test_cm_bifid tests/test_cm_bifid_solver tests/test_trisquare tests/test_trisquare_solver tests/test_intkey tests/test_intkey_solver tests/test_condi tests/test_condi_solver tests/test_fracmorse tests/test_fracmorse_solver tests/test_period_column tests/test_period_column_solver tests/test_period_column_space_solver tests/test_double_transposition tests/test_double_transposition_solver tests/test_pollux tests/test_pollux_solver tests/test_morbit tests/test_morbit_solver tests/test_straddling_checkerboard tests/test_straddling_checkerboard_solver tests/test_monome_dinome tests/test_monome_dinome_solver tests/test_tridigital tests/test_tridigital_solver tests/test_checkerboard tests/test_checkerboard_solver tests/test_ragbaby tests/test_ragbaby_solver tests/test_aristocrat tests/test_aristocrat_solver tests/test_sequence_transposition tests/test_sequence_transposition_solver tests/test_grandpre tests/test_grandpre_solver tests/test_syllabary tests/test_syllabary_solver tools/sequence_transposition_gen tools/grandpre_gen tools/syllabary_gen tools/ragbaby_gen tools/aristocrat_gen tools/monome_dinome_gen tools/tridigital_gen tools/checkerboard_gen tools/straddling_checkerboard_gen tools/period_column_gen tools/double_transposition_gen tools/pollux_gen tools/morbit_gen tools/fracmorse_gen tools/trisquare_gen tools/intkey_gen tools/condi_gen tools/homophonic_gen tools/digrafid_gen tools/cm_bifid_gen tools/seriated_playfair_gen tools/slidefair_gen tools/progkey_gen tools/portax_gen tools/bazeries_gen tools/nihilist_sub_gen tools/playfair_gen tools/bifid_gen tools/trifid_gen tools/hill_gen tools/gronsfeld_gen tools/phillips_gen tools/twosquare_gen tools/foursquare_gen tools/adfgvx_gen tools/gromark_gen tools/nicodemus_gen