Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (62 loc) · 4.26 KB
/
Copy pathMakefile
File metadata and controls
76 lines (62 loc) · 4.26 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
ifeq ($(origin CC),default)
CC := m68k-amigaos-gcc
endif
CC ?= m68k-amigaos-gcc
HOSTCC ?= cc
CFLAGS ?= -O2 -Wall -Wextra -Werror
# Keep the CPU and pre-2.0 runtime selection on compile AND link commands.
AMIGAFLAGS := -m68000 -mcrt=nix13
AMIGACPPFLAGS := -DAMIGUARD_NATIVE_XVS=1
CPPFLAGS ?= -Isrc
TARGET := AmiGuard
SRC := src/main.c src/scanner.c src/signatures.c src/trackdisk.c src/hunk.c src/file_intake.c src/file_signatures.c src/xvs_bridge.c src/disk_scanner.c src/volume_scanner.c src/image_scanner.c src/memory_scanner.c src/memory_exec_provider.c src/memory_vectors.c
OBJ := $(SRC:.c=.o)
.PHONY: all clean check host-test signatures signature-check file-signatures file-signature-check signature-manifest signature-manifest-check
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) $(AMIGAFLAGS) $(LDFLAGS) -o $@ $(OBJ)
src/%.o: src/%.c
$(CC) $(CPPFLAGS) $(AMIGACPPFLAGS) $(CFLAGS) $(AMIGAFLAGS) -c -o $@ $<
src/signatures.o: src/signatures_generated.inc
src/file_signatures.o: src/file_signatures_generated.inc
signatures:
python3 tools/compile_signatures.py --write
signature-check:
python3 tools/compile_signatures.py --check
file-signatures:
python3 tools/compile_file_signatures.py --write
file-signature-check:
python3 tools/compile_file_signatures.py --check
signature-manifest:
python3 tools/build_signature_manifest.py --write
signature-manifest-check:
python3 tools/build_signature_manifest.py --check
host-test: signature-check file-signature-check signature-manifest-check
mkdir -p build
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_scanner.c src/scanner.c src/signatures.c -o build/test_scanner
./build/test_scanner
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Itests/amiga_stubs -Isrc tests/test_trackdisk.c src/trackdisk.c -o build/test_trackdisk
./build/test_trackdisk
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_hunk.c src/hunk.c -o build/test_hunk
./build/test_hunk
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_file_signatures.c src/file_signatures.c -o build/test_file_signatures
./build/test_file_signatures
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_file_intake.c src/file_intake.c src/file_signatures.c src/hunk.c -o build/test_file_intake
./build/test_file_intake
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_disk_scanner.c src/disk_scanner.c -o build/test_disk_scanner
./build/test_disk_scanner
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_volume_scanner.c src/volume_scanner.c src/disk_scanner.c -o build/test_volume_scanner
./build/test_volume_scanner
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_image_scanner.c src/image_scanner.c src/disk_scanner.c src/scanner.c src/signatures.c -o build/test_image_scanner
./build/test_image_scanner
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_memory_scanner.c src/memory_scanner.c -o build/test_memory_scanner
./build/test_memory_scanner
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_memory_exec_provider.c src/memory_exec_provider.c -o build/test_memory_exec_provider
./build/test_memory_exec_provider
$(HOSTCC) -std=c89 -pedantic -Wall -Wextra -Werror -Isrc tests/test_memory_vectors.c src/memory_vectors.c -o build/test_memory_vectors
./build/test_memory_vectors
python3 -m unittest tests/test_analyze_bootblock.py tests/test_triage_corpus.py tests/test_build_review_queue.py tests/test_qualify_signature.py tests/test_build_clean_manifest.py tests/test_promote_signature.py tests/test_preflight_signature.py tests/test_finalize_signature.py tests/test_identify_known_bootblock.py tests/test_import_known_clean.py tests/test_preflight_known_clean.py tests/test_compile_file_signatures.py tests/test_qualify_eicar_acquisition.py tests/test_promote_safe_test.py tests/test_preflight_safe_test.py tests/test_extract_clean_adf_corpus.py tests/test_intake_research_sample.py tests/test_analyze_research_sample.py tests/test_review_file_signature_candidate.py tests/test_qualify_file_signature_candidate.py tests/test_promote_qualified_file_signature.py tests/test_finalize_file_signature.py tests/test_build_signature_manifest.py tests/test_validate_asw_handoff.py
check: host-test
clean:
rm -f $(OBJ) $(TARGET)
rm -rf build