-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
1517 lines (1393 loc) · 59.7 KB
/
Makefile
File metadata and controls
1517 lines (1393 loc) · 59.7 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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# System 7.1 Portable Makefile
# Builds complete System 7.1 kernel
# Build error handling: delete targets on failure, stop on first error
.DELETE_ON_ERROR:
.SUFFIXES:
# Default goal (build kernel)
.DEFAULT_GOAL := all
# Platform configuration
PLATFORM ?= x86
# If QEMU=1 is passed, automatically set PLATFORM to arm64
ifeq ($(QEMU),1)
PLATFORM = arm64
endif
# Raspberry Pi model selection (for ARM platform builds)
# Valid values: pi3, pi4, pi5 (or leave empty for runtime detection)
PI_MODEL ?=
# Load build configuration (default or user-specified)
CONFIG ?= default
-include config/$(CONFIG).mk
# Directories
BUILD_DIR = build
OBJ_DIR = $(BUILD_DIR)/obj
BIN_DIR = $(BUILD_DIR)/bin
ISO_DIR = iso
HAL_DIR = src/Platform/$(PLATFORM)
LINKER_SCRIPT := $(HAL_DIR)/linker.ld
# Output files
KERNEL = kernel.elf
ISO = system71.iso
# Raspberry Pi model-specific configuration
ifeq ($(PLATFORM),arm)
# Validate PI_MODEL if specified
ifneq ($(PI_MODEL),)
ifeq ($(filter $(PI_MODEL),pi3 pi4 pi5 virt),)
$(error Invalid PI_MODEL '$(PI_MODEL)'. Valid values: pi3, pi4, pi5, virt)
endif
endif
# Set ARM architecture based on Pi model
ifeq ($(PI_MODEL),pi3)
ARM_ARCH = armv6z
PI_CPU_NAME = "ARM Cortex-A53"
PI_CPU_FREQ = 1200
CFLAGS_PI = -march=armv6z -mfpu=neon -mfloat-abi=hard -DRASPI_MODEL=3 -DRASPI_CPU_FREQ=1200
else ifeq ($(PI_MODEL),pi4)
ARM_ARCH = armv7-a
PI_CPU_NAME = "ARM Cortex-A72"
PI_CPU_FREQ = 1500
CFLAGS_PI = -march=armv7-a -mfpu=neon -mfloat-abi=hard -DRASPI_MODEL=4 -DRASPI_CPU_FREQ=1500
else ifeq ($(PI_MODEL),pi5)
ARM_ARCH = armv7-a
PI_CPU_NAME = "ARM Cortex-A76"
PI_CPU_FREQ = 2400
CFLAGS_PI = -march=armv7-a -mfpu=neon -mfloat-abi=hard -DRASPI_MODEL=5 -DRASPI_CPU_FREQ=2400
else ifeq ($(PI_MODEL),virt)
ARM_ARCH = armv7-a
PI_CPU_NAME = "QEMU virt"
PI_CPU_FREQ = 1000
CFLAGS_PI = -march=armv7-a -mfpu=neon -mfloat-abi=hard -DQEMU_VIRT
else
# Default ARM architecture (runtime detection)
ARM_ARCH = armv7-a
PI_CPU_NAME = "ARM Cortex"
PI_CPU_FREQ = 0
CFLAGS_PI = -march=armv7-a -mfpu=neon -mfloat-abi=hard
endif
# ARM cross-compiler configuration
ARM_TARGET ?= arm-linux-gnueabihf
CROSS_COMPILE ?= arm-linux-gnueabihf-
CC = $(CROSS_COMPILE)gcc
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
ifeq ($(PI_MODEL),virt)
LINKER_SCRIPT := $(HAL_DIR)/linker_virt.ld
endif
else ifeq ($(PLATFORM),ppc)
# PowerPC cross-compiler configuration (override CROSS_COMPILE to suit your setup)
CROSS_COMPILE ?= powerpc-linux-gnu-
CC = $(CROSS_COMPILE)gcc
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
else
# x86 native compiler
CC = gcc
AS = as
LD = ld
OBJCOPY = objcopy
endif
# Common tools (non-platform specific)
GRUB = grub-mkrescue
# Flags
# [WM-050] SYS71_PROVIDE_FINDER_TOOLBOX=1 means: DO NOT provide Toolbox stubs; real implementations win.
# When defined, stubs in sys71_stubs.c are excluded via #ifndef guards.
# This ensures single source of truth per symbol (no duplicate definitions).
# [WM-052] Warnings are errors - no papering over issues
# Base CFLAGS (optimization level from config)
OPT_FLAGS = -O$(OPT_LEVEL)
ifeq ($(DEBUG_SYMBOLS),1)
OPT_FLAGS += -g
endif
# Platform-independent base flags
COMMON_CFLAGS = -DSYS71_PROVIDE_FINDER_TOOLBOX=1 \
-ffreestanding -fno-builtin -fno-stack-protector -nostdlib \
-fno-pic -fno-pie \
-Wall -Wextra -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wcast-qual \
-Wpointer-arith -Wstrict-prototypes -Wno-unused-parameter \
-Wundef -Wvla -Wcast-align -Wlogical-op -Wduplicated-cond -Wduplicated-branches \
-Wnull-dereference -Wjump-misses-init -Warray-bounds=2 -Wshift-overflow=2 \
$(OPT_FLAGS) -fno-inline -fno-optimize-sibling-calls -I./include -I./src -std=c2x \
-Wuninitialized -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 \
-Wno-multichar -Wno-pointer-sign -Wno-sign-compare \
-fno-common -fno-delete-null-pointer-checks \
-MMD -MP
# Platform-specific compiler flags
ifeq ($(PLATFORM),arm)
# ARM 32-bit with PI_MODEL-specific architecture
CFLAGS = $(COMMON_CFLAGS) $(CFLAGS_PI)
ASFLAGS =
LDFLAGS = -nostdlib -no-pie
# Set Gestalt machine type based on PI_MODEL
ifeq ($(PI_MODEL),pi3)
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := arm_pi3
endif
else ifeq ($(PI_MODEL),pi4)
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := arm_pi4
endif
else ifeq ($(PI_MODEL),pi5)
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := arm_pi5
endif
else
# Default for runtime detection
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := arm_pi3
endif
endif
else ifeq ($(PLATFORM),arm64)
# ARM 64-bit (AArch64) for QEMU virt machine
# Use aarch64 cross-compiler (prefer elf, fallback to linux-gnu)
AARCH64_PREFIX := $(shell command -v aarch64-elf-gcc >/dev/null 2>&1 && echo aarch64-elf || echo aarch64-linux-gnu)
CC = $(AARCH64_PREFIX)-gcc
AS = $(AARCH64_PREFIX)-as
LD = $(AARCH64_PREFIX)-ld
AR = $(AARCH64_PREFIX)-ar
CFLAGS = $(COMMON_CFLAGS) -march=armv8-a -ffreestanding -DQEMU_BUILD
ASFLAGS = -march=armv8-a
LDFLAGS = -nostdlib -no-pie -Wl,--allow-multiple-definition -Wl,-z,execstack
LINKER_SCRIPT := $(HAL_DIR)/link_qemu.ld
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := arm64_virt
endif
else ifeq ($(PLATFORM),ppc)
# PowerPC 32-bit big-endian
CFLAGS = $(COMMON_CFLAGS) -mbig-endian -mno-toc -mno-sdata
ASFLAGS := -mregnames -mbig-endian
LDFLAGS = -nostdlib -no-pie -melf32ppc
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := 0x0050
endif
else
# x86 32-bit
CFLAGS = $(COMMON_CFLAGS) -m32
ASFLAGS = --32
LDFLAGS = -melf_i386 -nostdlib -no-pie
ifeq ($(strip $(GESTALT_MACHINE_TYPE)),)
GESTALT_MACHINE_TYPE := 0
endif
endif
CFLAGS += -DDEFAULT_GESTALT_MACHINE_TYPE=$(GESTALT_MACHINE_TYPE)
CFLAGS += -DEXPANDMEM_FULL_IMPL=1
BEZEL_STYLE ?= auto
ifeq ($(strip $(BEZEL_STYLE)),rounded)
CFLAGS += -DDEFAULT_BEZEL_STYLE=1
else ifeq ($(strip $(BEZEL_STYLE)),flat)
CFLAGS += -DDEFAULT_BEZEL_STYLE=2
else
CFLAGS += -DDEFAULT_BEZEL_STYLE=0
endif
# Add feature flags based on configuration
ifeq ($(ENABLE_RESOURCES),1)
CFLAGS += -DENABLE_RESOURCES=1
endif
ifeq ($(ENABLE_FILEMGR_EXTRA),1)
CFLAGS += -DENABLE_FILEMGR_EXTRA=1
endif
ifeq ($(ENABLE_PROCESS_COOP),1)
CFLAGS += -DENABLE_PROCESS_COOP=1
endif
ifeq ($(MODERN_INPUT_ONLY),1)
CFLAGS += -DMODERN_INPUT_ONLY=1
endif
# Resource files
RSRC_JSON = patterns.json
RSRC_BIN = Patterns.rsrc
PATTERN_RESOURCE ?= resources/patterns_authentic_color.json
# 68K Interpreter for ARM Raspberry Pi Support
# The 68K interpreter is platform-independent and included unconditionally in all builds.
# It enables System 7.1 classic Mac applications to run on both x86 and ARM (Raspberry Pi 3/4/5).
# The interpreter uses explicit big-endian byte ordering for cross-platform compatibility.
# Source files
C_SOURCES = src/main.c \
src/boot.c \
src/SystemInit.c \
src/sys71_stubs.c \
src/System71StdLib.c \
src/runtime_stubs.c \
src/System/SystemTheme.c \
src/ToolboxCompat.c \
src/Toolbox/IconUtilities.c \
src/Finder/finder_main.c \
src/Finder/desktop_manager.c \
src/Finder/folder_window.c \
src/Finder/alias_manager.c \
src/Finder/trash_folder.c \
src/Finder/AboutThisMac.c \
src/Finder/GetInfo.c \
src/Finder/Find.c \
src/ExpandMem.c \
src/QuickDraw/QuickDrawCore.c \
src/QuickDraw/Bitmaps.c \
src/QuickDraw/QuickDrawPlatform.c \
src/QuickDraw/quickdraw_pictures.c \
src/QuickDraw/CursorManager.c \
src/QuickDraw/Coordinates.c \
src/QuickDraw/Regions.c \
src/QuickDraw/Pictures.c \
src/QuickDraw/ColorQuickDraw.c \
src/QuickDraw/GWorld.c \
src/QuickDraw/Patterns.c \
src/QuickDraw/display_bezel.c \
src/ColorManager/ColorManager.c \
src/OSUtils/OSUtilsTraps.c \
src/OSUtils/Munger.c \
src/OSUtils/DateTime.c \
src/OSUtils/QueueUtilities.c \
src/OSUtils/BitManipulation.c \
src/OSUtils/BitwiseOperations.c \
src/OSUtils/FixedPointMath.c \
src/OSUtils/MemoryUtilities.c \
src/OSUtils/DebugUtils.c \
src/Platform/WindowPlatform.c \
$(if $(filter arm64,$(PLATFORM)), \
src/Platform/arm64/uart_qemu.c \
src/Platform/arm64/hal_boot.c \
src/Platform/arm64/serial.c \
src/Platform/arm64/timer.c \
src/Platform/arm64/dtb.c \
src/Platform/arm64/virtio_gpu.c \
src/Platform/arm64/virtio_pci.c \
src/Platform/arm64/virtio_input.c \
src/Platform/arm64/virtio_blk.c \
src/Platform/arm64/mmu.c \
src/Platform/arm64/cache.c \
src/Platform/arm64/exception_handlers.c \
src/Platform/arm64/string.c \
src/Platform/arm64/printf.c \
src/Platform/arm64/io.c \
src/Platform/arm64/hal_input.c \
src/Platform/arm64/platform_info.c \
src/Platform/arm64/storage.c \
src/Platform/arm64/dwc2.c \
src/Platform/arm64/usb_core.c \
src/Platform/arm64/usb_hid.c \
src/Platform/arm64/sdhci.c \
src/Platform/arm64/display.c, \
$(if $(filter arm,$(PLATFORM)), \
src/Platform/arm/hal_boot.c \
src/Platform/arm/io.c \
src/Platform/arm/device_tree.c \
src/Platform/arm/hardware_detect.c \
src/Platform/arm/platform_info.c \
src/Platform/arm/mmio.c \
src/Platform/arm/videocore.c \
src/Platform/arm/framebuffer.c \
src/Platform/arm/timer_arm.c \
src/Platform/arm/sdhci.c \
src/Platform/arm/sdhci_commands.c \
src/Platform/arm/storage.c \
src/Platform/arm/audio_hdmi.c \
src/Platform/arm/xhci.c \
src/Platform/arm/dwcotg.c \
src/Platform/arm/usb_controller.c \
src/Platform/arm/hid_input.c \
src/Platform/arm/input_stubs.c \
src/Platform/arm/network.c, \
$(if $(filter ppc,$(PLATFORM)), \
src/Platform/ppc/hal_boot.c \
src/Platform/ppc/io.c \
src/Platform/ppc/platform_info.c \
src/Platform/ppc/hal_input.c \
src/Platform/ppc/storage.c \
src/Platform/ppc/open_firmware.c \
src/Platform/ppc/escc_uart.c \
src/Platform/ppc/input_stubs.c \
src/Platform/ppc/network.c, \
src/Platform/x86/io.c \
src/Platform/x86/ata.c \
src/Platform/x86/ps2.c \
src/Platform/x86/pci.c \
src/Platform/x86/pci_irq.c \
src/Platform/x86/xhci.c \
src/Platform/x86/ehci.c \
src/Platform/x86/uhci.c \
src/Platform/x86/usb_core.c \
src/Platform/x86/e1000.c \
src/Platform/x86/network.c \
src/Platform/x86/idt.c \
src/Platform/x86/pic.c \
src/Platform/x86/pit.c \
src/Platform/x86/rtc.c \
src/Platform/x86/platform_info.c \
src/Platform/x86/hal_boot.c \
src/Platform/x86/hal_input.c))) \
src/SoundManager/SoundManagerBareMetal.c \
src/SoundManager/SoundHardwarePC.c \
src/SoundManager/SoundBackend.c \
src/SoundManager/SoundBackend_HDA.c \
src/SoundManager/SoundBackend_SB16.c \
src/SoundManager/SoundEffects.c \
src/SoundManager/SoundBlaster16.c \
src/SoundManager/DMA_Controller.c \
src/MenuManager/MenuManagerCore.c \
src/MenuManager/MenuSelection.c \
src/MenuManager/MenuDisplay.c \
src/MenuManager/menu_savebits.c \
src/MenuManager/MenuBitsPool.c \
src/MenuManager/MenuTitleTracking.c \
src/MenuManager/MenuTrack.c \
src/MenuManager/MenuAppleIcon.c \
src/MenuManager/MenuAppIcon.c \
src/MenuManager/MenuItems.c \
src/MenuManager/MenuResources.c \
src/MenuManager/platform_stubs.c \
src/MenuManager/menu_stubs.c \
src/MenuCommands.c \
src/Finder/Icon/icon_system.c \
src/Finder/Icon/icon_resources.c \
src/Finder/Icon/icon_resolver.c \
src/Finder/Icon/icon_draw.c \
src/Finder/Icon/icon_label.c \
src/trash_icons.c \
src/chicago_font_data.c \
src/FontManager/FontManagerCore.c \
src/FontManager/FontResourceLoader.c \
src/FontManager/FontStyleSynthesis.c \
src/FontManager/FontScaling.c \
src/test_fontmgr.c \
src/PatternMgr/pattern_manager.c \
src/PatternMgr/pattern_resources.c \
src/PatternMgr/pram_prefs.c \
src/Resources/pattern_data.c \
src/Resources/happy_mac_icon.c \
src/Resources/generated/icons_generated.c \
src/Resources/ResourceData.c \
src/ControlPanels/cdev_desktop.c \
src/simple_resource_manager.c \
src/ControlManager/ControlManagerCore.c \
src/ControlManager/ControlTracking.c \
src/ControlManager/ScrollbarControls.c \
src/ControlManager/StandardControls.c \
src/ControlManager/ControlResources.c \
src/ControlManager/ControlSmoke.c \
src/control_stubs.c \
src/ControlPanels/sound_cdev.c \
src/ControlPanels/mouse_cdev.c \
src/ControlPanels/keyboard_cdev.c \
src/ControlPanels/control_strip.c \
src/Datetime/datetime_cdev.c \
src/patterns_rsrc.c \
src/strings_en_rsrc.c \
src/LocaleManager/LocaleManager.c \
src/chicago_font_extended_data.c \
src/TextEncoding/CJKEncoding.c \
src/FontManager/CJKFont.c \
src/FS/hfs_diskio.c \
src/FS/hfs_volume.c \
src/FS/hfs_btree.c \
src/FS/hfs_catalog.c \
src/FS/hfs_file.c \
src/FS/vfs.c \
src/FS/trash.c \
src/FS/vfs_ops.c \
src/MemoryMgr/MemoryManager.c \
src/MemoryMgr/memory_manager_core.c \
src/MemoryMgr/heap_compaction.c \
src/MemoryMgr/blockmove_optimization.c \
src/MemoryMgr/HandleUtilities.c \
src/MemoryMgr/MemoryInitialization.c \
src/Resources/Icons/hd_icon.c \
src/color_icons.c \
src/DeskManager/DeskManagerCore.c \
src/DeskManager/DeskManagerStubs.c \
src/DeskManager/BuiltinDAs.c \
src/DeskManager/DALoader.c \
src/DeskManager/SystemMenu.c \
src/DeskManager/DAPreferences.c \
src/DeskManager/KeyCaps.c \
src/DeskManager/Notepad.c \
src/DeskManager/Calculator.c \
src/DeskManager/AlarmClock.c \
src/DeskManager/Chooser.c \
src/DialogManager/DialogManagerCore.c \
src/DialogManager/DialogManagerStubs.c \
src/DialogManager/ModalDialogs.c \
src/DialogManager/AlertDialogs.c \
src/DialogManager/AlertSmoke.c \
src/DialogManager/DialogEvents.c \
src/DialogManager/DialogItems.c \
src/DialogManager/DialogResourceParser.c \
src/DialogManager/DialogDrawing.c \
src/DialogManager/DialogEditText.c \
src/DialogManager/dialog_manager_private.c \
src/DialogManager/DialogHelpers.c \
src/DialogManager/DialogKeyboard.c \
src/StandardFile/StandardFile.c \
src/StandardFile/StandardFileHAL_Shims.c \
src/StandardFile/Pack3_StandardFile.c \
src/PackageManager/StringConversion.c \
src/PackageManager/DateTimeFormatting.c \
src/PackageManager/StringUtilities.c \
src/PackageManager/StringManipulation.c \
src/PackageManager/StringComparison.c \
src/PackageManager/CharacterClassification.c \
src/PackageManager/InternationalUtilities.c \
src/PackageManager/PackageManagerCore.c \
src/PackageManager/TextEncodingUtils.c \
src/PackageManager/InternationalOrdering.c \
src/PackageManager/Pack4_SANE.c \
src/PackageManager/Pack6_InternationalUtils.c \
src/PackageManager/Pack7_BinaryDecimal.c \
src/PackageManager/Pack_Stubs.c \
src/FileManager.c \
src/FileManagerStubs.c \
src/EventManager/event_manager.c \
src/EventManager/EventGlobals.c \
src/EventManager/ModernInput.c \
src/EventManager/EventDispatcher.c \
src/EventManager/MouseEvents.c \
src/EventManager/KeyboardEvents.c \
src/EventManager/AppSwitcher.c \
src/EventManager/SystemEvents.c \
src/ProcessMgr/ProcessManager.c \
src/ProcessMgr/AppFileManager.c \
src/ProcessMgr/ProcessAPI.c \
src/CPU/CPUBackend.c \
src/CPU/m68k_interp/M68KBackend.c \
src/CPU/m68k_interp/M68KDecode.c \
src/CPU/m68k_interp/M68KOpcodes.c \
src/CPU/m68k_interp/LowMemGlobals.c \
src/CPU/ppc_interp/PPCBackend.c \
src/CPU/ppc_interp/PPCOpcodes.c \
src/SegmentLoader/SegmentLoader.c \
src/SegmentLoader/CodeParser.c \
src/SegmentLoader/A5World.c \
src/SegmentLoader/SegmentLoaderTest.c \
src/TextEdit/TextEdit.c \
src/TextEdit/TextEditDraw.c \
src/TextEdit/TextEditInput.c \
src/TextEdit/TextEditScroll.c \
src/TextEdit/TextEditClipboard.c \
src/TextEdit/TextBreak.c \
src/TextEdit/TextEditTest.c \
src/WindowManager/WindowDisplay.c \
src/WindowManager/WindowEvents.c \
src/WindowManager/WindowManagerCore.c \
src/WindowManager/WindowManagerHelpers.c \
src/WindowManager/WindowDragging.c \
src/WindowManager/WindowResizing.c \
src/WindowManager/WindowLayering.c \
src/WindowManager/WindowParts.c \
src/WindowManager/WindowGeometry.c \
src/WindowManager/WindowRegions.c \
src/TimeManager/PlatformTime.c \
src/TimeManager/TimeBase.c \
src/TimeManager/MicrosecondTimer.c \
src/TimeManager/TimeManager.c \
src/TimeManager/TimeManagerCore.c \
src/TimeManager/TimerInterrupts.c \
src/TimeManager/TimerTasks.c \
src/Apps/SimpleText/SimpleText.c \
src/Apps/SimpleText/STDocument.c \
src/Apps/SimpleText/STView.c \
src/Apps/SimpleText/STMenus.c \
src/Apps/SimpleText/STFileIO.c \
src/Apps/SimpleText/STClipboard.c \
src/Apps/MacPaint/MacPaint_Core.c \
src/Apps/MacPaint/MacPaint_Tools.c \
src/Apps/MacPaint/MacPaint_FileIO.c \
src/Apps/MacPaint/MacPaint_Menus.c \
src/Apps/MacPaint/MacPaint_Advanced.c \
src/Apps/MacPaint/MacPaint_Integration.c \
src/Apps/MacPaint/MacPaint_EventLoop.c \
src/Apps/MacPaint/MacPaint_Rendering.c \
src/Apps/MacPaint/MacPaint_Main.c \
src/StartupScreen/StartupScreen.c
# Add IntegrationTests if enabled
ifeq ($(INTEGRATION_TESTS),1)
C_SOURCES += src/Integration/IntegrationTests.c
CFLAGS += -DINTEGRATION_TESTS=1
endif
# Add Phase 2 Integration Tests if enabled
ifeq ($(PHASE2_TESTS),1)
C_SOURCES += src/Integration/Phase2_EventDispatch.c \
src/Integration/Phase2_FileIO.c \
src/Integration/Phase2_DialogManager.c \
src/Integration/Phase2_TextEdit.c \
src/Integration/Phase2_QuickDraw.c \
src/Integration/Phase2_WindowManager.c \
src/Integration/Phase2_AppStartup.c \
src/Integration/Phase2_SoundManager.c \
src/Integration/Phase2_Rendering.c
CFLAGS += -DPHASE2_TESTS=1
endif
# Add ResourceMgr sources if enabled
ifeq ($(ENABLE_RESOURCES),1)
C_SOURCES += src/ResourceMgr/ResourceMgr.c \
src/ResourceMgr/StringResources.c
endif
# Add FileMgr extra sources if enabled
ifeq ($(ENABLE_FILEMGR_EXTRA),1)
C_SOURCES += src/FileMgr/btree_services.c \
src/FileMgr/extent_manager.c \
src/FileMgr/tfs_dispatch.c \
src/FileMgr/volume_manager.c
endif
# Add Gestalt Manager if enabled
ifeq ($(ENABLE_GESTALT),1)
C_SOURCES += src/Gestalt/Gestalt.c \
src/Gestalt/GestaltBuiltins.c
CFLAGS += -DENABLE_GESTALT=1
endif
# Conditionally add Process Manager cooperative scheduling
ifeq ($(ENABLE_PROCESS_COOP),1)
C_SOURCES += src/ProcessMgr/CooperativeScheduler.c \
src/ProcessMgr/EventIntegration.c
endif
# Add ScrapManager if enabled
ifeq ($(ENABLE_SCRAP),1)
C_SOURCES += src/ScrapManager/ScrapManager.c
CFLAGS += -DENABLE_SCRAP=1
# Enable self-test for debugging
CFLAGS += -DSCRAP_SELFTEST=1 -DDEBUG_DOUBLECLICK=1
endif
# Add ListManager if enabled
ifeq ($(ENABLE_LIST),1)
C_SOURCES += src/ListManager/ListManager.c \
src/ListManager/list_manager.c \
src/ListManager/ListSmoke.c \
src/ListManager/Pack0_ListManager.c
CFLAGS += -DENABLE_LIST=1
ifeq ($(LIST_SMOKE_TEST),1)
CFLAGS += -DLIST_SMOKE_TEST=1
endif
endif
# Add ExtensionManager and related loaders
C_SOURCES += src/ExtensionManager/ExtensionManagerCore.c \
src/ExtensionManager/CDEFLoader.c \
src/ExtensionManager/ControlPanelManager.c \
src/ExtensionManager/DRVRLoader.c \
src/ExtensionManager/FKEYLoader.c \
src/ExtensionManager/DefLoader.c
CFLAGS += -DENABLE_EXTENSIONS=1
# Speech Manager - Minimal implementation with SoundManager integration
C_SOURCES += src/SpeechManager/SpeechManagerCore.c \
src/SpeechManager/SpeechOutput_Stub.c \
src/SpeechManager/SpeechSmoke.c
CFLAGS += -DENABLE_SPEECH=1
# Speech Manager smoke test (optional testing)
ifeq ($(SPEECH_SMOKE_TEST),1)
CFLAGS += -DSPEECH_SMOKE_TEST=1
endif
# Notification Manager - Background notification system
C_SOURCES += src/NotificationManager/NotificationManagerCore.c
CFLAGS += -DENABLE_NOTIFICATION=1
# Add Control smoke test if enabled
ifeq ($(CTRL_SMOKE_TEST),1)
CFLAGS += -DCTRL_SMOKE_TEST=1
endif
# Alert smoke test (alert dialogs)
ifeq ($(ALERT_SMOKE_TEST),1)
CFLAGS += -DALERT_SMOKE_TEST=1
endif
ASM_SOURCES = $(HAL_DIR)/platform_boot.S
ifeq ($(PLATFORM),x86)
ASM_SOURCES += $(HAL_DIR)/idt.S
endif
ifeq ($(PLATFORM),arm64)
ASM_SOURCES += $(HAL_DIR)/exceptions.S
endif
# Object files
C_OBJECTS = $(patsubst src/%.c,$(OBJ_DIR)/%.o,$(C_SOURCES))
ASM_OBJECTS = $(patsubst %.S,$(OBJ_DIR)/%.o,$(notdir $(ASM_SOURCES)))
OBJECTS = $(ASM_OBJECTS) $(C_OBJECTS)
# Dependency files (auto-generated by -MMD -MP)
DEPS = $(C_OBJECTS:.o=.d)
# Include dependency files if they exist
-include $(DEPS)
# Build directories (created as order-only prerequisites for parallel builds)
BUILD_DIRS = $(BUILD_DIR) $(OBJ_DIR) $(BIN_DIR) $(ISO_DIR)/boot/grub
$(BUILD_DIRS):
@mkdir -p $@
# Tool version requirements
GCC_MIN_VERSION = 7.0
PYTHON_MIN_VERSION = 3.6
# Check build tools (run once per make invocation)
.PHONY: check-tools
check-tools:
@PLATFORM=$(PLATFORM) scripts/check_tool_versions.sh $(GCC_MIN_VERSION) $(PYTHON_MIN_VERSION)
# Default target
all: check-tools $(RSRC_BIN) $(KERNEL)
# Build resource file
$(RSRC_BIN): $(RSRC_JSON) $(PATTERN_RESOURCE) gen_rsrc.py
@echo "GEN $(RSRC_BIN)"
@python3 gen_rsrc.py $(RSRC_JSON) $(PATTERN_RESOURCE) $(RSRC_BIN) || \
{ echo "ERROR: Resource generation failed"; exit 1; }
@test -f $(RSRC_BIN) || { echo "ERROR: $(RSRC_BIN) not created"; exit 1; }
@echo "✓ Resource file generated successfully"
# Convert resource file to C source
src/patterns_rsrc.c: $(RSRC_BIN)
@echo "XXDC $<"
@echo '/* Auto-generated from Patterns.rsrc */' > $@
@echo 'const unsigned char patterns_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int patterns_rsrc_size = sizeof(patterns_rsrc_data);' >> $@
# Generate locale string resources
$(BUILD_DIR)/Strings_en.rsrc: resources/strings/en.json gen_rsrc.py | $(BUILD_DIR)
@echo "GEN Strings_en.rsrc"
@python3 gen_rsrc.py resources/strings/en.json $@
src/strings_en_rsrc.c: $(BUILD_DIR)/Strings_en.rsrc
@echo "XXDC Strings_en.rsrc"
@echo '/* Auto-generated from Strings_en.rsrc */' > $@
@echo 'const unsigned char strings_en_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_en_rsrc_size = sizeof(strings_en_rsrc_data);' >> $@
# Optional locale resources (add LOCALE_XX=1 to build with additional languages)
ifeq ($(LOCALE_FR),1)
CFLAGS += -DLOCALE_FR=1
C_SOURCES += src/strings_fr_rsrc.c
$(BUILD_DIR)/Strings_fr.rsrc: resources/strings/fr.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/fr.json $@
src/strings_fr_rsrc.c: $(BUILD_DIR)/Strings_fr.rsrc
@echo '/* Auto-generated from Strings_fr.rsrc */' > $@
@echo 'const unsigned char strings_fr_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_fr_rsrc_size = sizeof(strings_fr_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_DE),1)
CFLAGS += -DLOCALE_DE=1
C_SOURCES += src/strings_de_rsrc.c
$(BUILD_DIR)/Strings_de.rsrc: resources/strings/de.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/de.json $@
src/strings_de_rsrc.c: $(BUILD_DIR)/Strings_de.rsrc
@echo '/* Auto-generated from Strings_de.rsrc */' > $@
@echo 'const unsigned char strings_de_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_de_rsrc_size = sizeof(strings_de_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_ES),1)
CFLAGS += -DLOCALE_ES=1
C_SOURCES += src/strings_es_rsrc.c
$(BUILD_DIR)/Strings_es.rsrc: resources/strings/es.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/es.json $@
src/strings_es_rsrc.c: $(BUILD_DIR)/Strings_es.rsrc
@echo '/* Auto-generated from Strings_es.rsrc */' > $@
@echo 'const unsigned char strings_es_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_es_rsrc_size = sizeof(strings_es_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_JA),1)
CFLAGS += -DLOCALE_JA=1
C_SOURCES += src/strings_ja_rsrc.c
$(BUILD_DIR)/Strings_ja.rsrc: resources/strings/ja.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/ja.json $@
src/strings_ja_rsrc.c: $(BUILD_DIR)/Strings_ja.rsrc
@echo '/* Auto-generated from Strings_ja.rsrc */' > $@
@echo 'const unsigned char strings_ja_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_ja_rsrc_size = sizeof(strings_ja_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_ZH),1)
CFLAGS += -DLOCALE_ZH=1
C_SOURCES += src/strings_zh_rsrc.c
$(BUILD_DIR)/Strings_zh.rsrc: resources/strings/zh.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/zh.json $@
src/strings_zh_rsrc.c: $(BUILD_DIR)/Strings_zh.rsrc
@echo '/* Auto-generated from Strings_zh.rsrc */' > $@
@echo 'const unsigned char strings_zh_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_zh_rsrc_size = sizeof(strings_zh_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_KO),1)
CFLAGS += -DLOCALE_KO=1
C_SOURCES += src/strings_ko_rsrc.c
$(BUILD_DIR)/Strings_ko.rsrc: resources/strings/ko.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/ko.json $@
src/strings_ko_rsrc.c: $(BUILD_DIR)/Strings_ko.rsrc
@echo '/* Auto-generated from Strings_ko.rsrc */' > $@
@echo 'const unsigned char strings_ko_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_ko_rsrc_size = sizeof(strings_ko_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_RU),1)
CFLAGS += -DLOCALE_RU=1
C_SOURCES += src/strings_ru_rsrc.c
$(BUILD_DIR)/Strings_ru.rsrc: resources/strings/ru.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/ru.json $@
src/strings_ru_rsrc.c: $(BUILD_DIR)/Strings_ru.rsrc
@echo '/* Auto-generated from Strings_ru.rsrc */' > $@
@echo 'const unsigned char strings_ru_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_ru_rsrc_size = sizeof(strings_ru_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_UK),1)
CFLAGS += -DLOCALE_UK=1
C_SOURCES += src/strings_uk_rsrc.c
$(BUILD_DIR)/Strings_uk.rsrc: resources/strings/uk.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/uk.json $@
src/strings_uk_rsrc.c: $(BUILD_DIR)/Strings_uk.rsrc
@echo '/* Auto-generated from Strings_uk.rsrc */' > $@
@echo 'const unsigned char strings_uk_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_uk_rsrc_size = sizeof(strings_uk_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_PL),1)
CFLAGS += -DLOCALE_PL=1
C_SOURCES += src/strings_pl_rsrc.c
$(BUILD_DIR)/Strings_pl.rsrc: resources/strings/pl.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/pl.json $@
src/strings_pl_rsrc.c: $(BUILD_DIR)/Strings_pl.rsrc
@echo '/* Auto-generated from Strings_pl.rsrc */' > $@
@echo 'const unsigned char strings_pl_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_pl_rsrc_size = sizeof(strings_pl_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_CS),1)
CFLAGS += -DLOCALE_CS=1
C_SOURCES += src/strings_cs_rsrc.c
$(BUILD_DIR)/Strings_cs.rsrc: resources/strings/cs.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/cs.json $@
src/strings_cs_rsrc.c: $(BUILD_DIR)/Strings_cs.rsrc
@echo '/* Auto-generated from Strings_cs.rsrc */' > $@
@echo 'const unsigned char strings_cs_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_cs_rsrc_size = sizeof(strings_cs_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_SQ),1)
CFLAGS += -DLOCALE_SQ=1
C_SOURCES += src/strings_sq_rsrc.c
$(BUILD_DIR)/Strings_sq.rsrc: resources/strings/sq.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/sq.json $@
src/strings_sq_rsrc.c: $(BUILD_DIR)/Strings_sq.rsrc
@echo '/* Auto-generated from Strings_sq.rsrc */' > $@
@echo 'const unsigned char strings_sq_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_sq_rsrc_size = sizeof(strings_sq_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_BG),1)
CFLAGS += -DLOCALE_BG=1
C_SOURCES += src/strings_bg_rsrc.c
$(BUILD_DIR)/Strings_bg.rsrc: resources/strings/bg.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/bg.json $@
src/strings_bg_rsrc.c: $(BUILD_DIR)/Strings_bg.rsrc
@echo '/* Auto-generated from Strings_bg.rsrc */' > $@
@echo 'const unsigned char strings_bg_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_bg_rsrc_size = sizeof(strings_bg_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_HR),1)
CFLAGS += -DLOCALE_HR=1
C_SOURCES += src/strings_hr_rsrc.c
$(BUILD_DIR)/Strings_hr.rsrc: resources/strings/hr.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/hr.json $@
src/strings_hr_rsrc.c: $(BUILD_DIR)/Strings_hr.rsrc
@echo '/* Auto-generated from Strings_hr.rsrc */' > $@
@echo 'const unsigned char strings_hr_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_hr_rsrc_size = sizeof(strings_hr_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_DA),1)
CFLAGS += -DLOCALE_DA=1
C_SOURCES += src/strings_da_rsrc.c
$(BUILD_DIR)/Strings_da.rsrc: resources/strings/da.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/da.json $@
src/strings_da_rsrc.c: $(BUILD_DIR)/Strings_da.rsrc
@echo '/* Auto-generated from Strings_da.rsrc */' > $@
@echo 'const unsigned char strings_da_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_da_rsrc_size = sizeof(strings_da_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_NL),1)
CFLAGS += -DLOCALE_NL=1
C_SOURCES += src/strings_nl_rsrc.c
$(BUILD_DIR)/Strings_nl.rsrc: resources/strings/nl.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/nl.json $@
src/strings_nl_rsrc.c: $(BUILD_DIR)/Strings_nl.rsrc
@echo '/* Auto-generated from Strings_nl.rsrc */' > $@
@echo 'const unsigned char strings_nl_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_nl_rsrc_size = sizeof(strings_nl_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_ET),1)
CFLAGS += -DLOCALE_ET=1
C_SOURCES += src/strings_et_rsrc.c
$(BUILD_DIR)/Strings_et.rsrc: resources/strings/et.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/et.json $@
src/strings_et_rsrc.c: $(BUILD_DIR)/Strings_et.rsrc
@echo '/* Auto-generated from Strings_et.rsrc */' > $@
@echo 'const unsigned char strings_et_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_et_rsrc_size = sizeof(strings_et_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_FI),1)
CFLAGS += -DLOCALE_FI=1
C_SOURCES += src/strings_fi_rsrc.c
$(BUILD_DIR)/Strings_fi.rsrc: resources/strings/fi.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/fi.json $@
src/strings_fi_rsrc.c: $(BUILD_DIR)/Strings_fi.rsrc
@echo '/* Auto-generated from Strings_fi.rsrc */' > $@
@echo 'const unsigned char strings_fi_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_fi_rsrc_size = sizeof(strings_fi_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_EL),1)
CFLAGS += -DLOCALE_EL=1
C_SOURCES += src/strings_el_rsrc.c
$(BUILD_DIR)/Strings_el.rsrc: resources/strings/el.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/el.json $@
src/strings_el_rsrc.c: $(BUILD_DIR)/Strings_el.rsrc
@echo '/* Auto-generated from Strings_el.rsrc */' > $@
@echo 'const unsigned char strings_el_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_el_rsrc_size = sizeof(strings_el_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_HU),1)
CFLAGS += -DLOCALE_HU=1
C_SOURCES += src/strings_hu_rsrc.c
$(BUILD_DIR)/Strings_hu.rsrc: resources/strings/hu.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/hu.json $@
src/strings_hu_rsrc.c: $(BUILD_DIR)/Strings_hu.rsrc
@echo '/* Auto-generated from Strings_hu.rsrc */' > $@
@echo 'const unsigned char strings_hu_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_hu_rsrc_size = sizeof(strings_hu_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_IS),1)
CFLAGS += -DLOCALE_IS=1
C_SOURCES += src/strings_is_rsrc.c
$(BUILD_DIR)/Strings_is.rsrc: resources/strings/is.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/is.json $@
src/strings_is_rsrc.c: $(BUILD_DIR)/Strings_is.rsrc
@echo '/* Auto-generated from Strings_is.rsrc */' > $@
@echo 'const unsigned char strings_is_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_is_rsrc_size = sizeof(strings_is_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_IT),1)
CFLAGS += -DLOCALE_IT=1
C_SOURCES += src/strings_it_rsrc.c
$(BUILD_DIR)/Strings_it.rsrc: resources/strings/it.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/it.json $@
src/strings_it_rsrc.c: $(BUILD_DIR)/Strings_it.rsrc
@echo '/* Auto-generated from Strings_it.rsrc */' > $@
@echo 'const unsigned char strings_it_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_it_rsrc_size = sizeof(strings_it_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_LV),1)
CFLAGS += -DLOCALE_LV=1
C_SOURCES += src/strings_lv_rsrc.c
$(BUILD_DIR)/Strings_lv.rsrc: resources/strings/lv.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/lv.json $@
src/strings_lv_rsrc.c: $(BUILD_DIR)/Strings_lv.rsrc
@echo '/* Auto-generated from Strings_lv.rsrc */' > $@
@echo 'const unsigned char strings_lv_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_lv_rsrc_size = sizeof(strings_lv_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_LT),1)
CFLAGS += -DLOCALE_LT=1
C_SOURCES += src/strings_lt_rsrc.c
$(BUILD_DIR)/Strings_lt.rsrc: resources/strings/lt.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/lt.json $@
src/strings_lt_rsrc.c: $(BUILD_DIR)/Strings_lt.rsrc
@echo '/* Auto-generated from Strings_lt.rsrc */' > $@
@echo 'const unsigned char strings_lt_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@
@echo 'const unsigned int strings_lt_rsrc_size = sizeof(strings_lt_rsrc_data);' >> $@
endif
ifeq ($(LOCALE_MK),1)
CFLAGS += -DLOCALE_MK=1
C_SOURCES += src/strings_mk_rsrc.c
$(BUILD_DIR)/Strings_mk.rsrc: resources/strings/mk.json gen_rsrc.py | $(BUILD_DIR)
@python3 gen_rsrc.py resources/strings/mk.json $@
src/strings_mk_rsrc.c: $(BUILD_DIR)/Strings_mk.rsrc
@echo '/* Auto-generated from Strings_mk.rsrc */' > $@
@echo 'const unsigned char strings_mk_rsrc_data[] = {' >> $@
@xxd -i < $< >> $@
@echo '};' >> $@