-
Notifications
You must be signed in to change notification settings - Fork 3
/
Mk.Win32
executable file
·97 lines (84 loc) · 2.66 KB
/
Mk.Win32
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
#!/usr/bin/make
# Mk.Win32
# Greg Cook, 7/Feb/2017
# CRC RevEng: arbitrary-precision CRC calculator and algorithm finder
# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
# Gregory Cook
#
# This file is part of CRC RevEng.
#
# CRC RevEng is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# CRC RevEng is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with CRC RevEng. If not, see <https://www.gnu.org/licenses/>.
# C compiler and flags. Adjust to taste.
CC = gcc
CFLAGS = -O3 -Wall -march=i586 -ansi -fomit-frame-pointer
# Binary optimiser
STRIP = strip
SFLAGS = --strip-unneeded
# Windows resource compiler
WINDRES = windres
WFLAGS = -O coff
# Shell commands
RM = rm
TOUCH = touch
FALSE = false
# Executable extension
EXT = .exe
# Target executable
EXE = reveng
# Target objects
TARGETS = bmpbit.o cli.o model.o poly.o preset.o reveng.o reveng.res
# Header files
HEADERS = config.h reveng.h
# Pre-compiled executables and generated files
BINS = bin/armtubeos/reveng \
bin/armtubeos/reveng$(EXT) \
bin/i386-linux/reveng \
bin/i386-linux/reveng$(EXT) \
bin/raspbian/reveng \
bin/raspbian/reveng$(EXT) \
bin/riscos/reveng \
bin/riscos/reveng$(EXT) \
bin/win32/reveng \
bin/win32/reveng$(EXT) \
bmptst \
bmptst$(EXT) \
pretst \
pretst$(EXT) \
reveng \
reveng$(EXT) \
reveng.res \
core
# CRC RevEng will compile without macros, but these may be useful:
# Add -DBMPMACRO to use bitmap size constant macros (edit config.h)
# Add -DNOFORCE to disable the -F switch
# Add -DPRESETS to compile with preset models (edit config.h)
MACROS = -DPRESETS
.PHONY: clean all
all: $(EXE)
$(EXE): $(TARGETS)
$(MAKE) bmptst
$(CC) $(CFLAGS) -o $@ $+
-$(STRIP) $(SFLAGS) $@ $@$(EXT)
%.o: %.c $(HEADERS) bmptst
$(CC) $(CFLAGS) $(MACROS) -c $<
%.res: %.rc
$(WINDRES) $(WFLAGS) -o $@ $<
bmptst: bmpbit.c $(HEADERS)
$(CC) $(CFLAGS) $(MACROS) -DBMPTST -o $@ $<
( ./$@ && $(TOUCH) $@ ) || ( $(RM) $@ $@$(EXT) && $(FALSE) )
pretst: bmpbit.c model.c poly.c preset.c $(HEADERS)
$(CC) $(CFLAGS) $(MACROS) -DPRETST -o $@ bmpbit.c model.c poly.c preset.c
( ./$@ && $(TOUCH) $@ ) || ( $(RM) $@ $@$(EXT) && $(FALSE) )
clean:
-$(RM) $(EXE) $(TARGETS) $(BINS)