-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (28 loc) · 845 Bytes
/
Makefile
File metadata and controls
34 lines (28 loc) · 845 Bytes
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
# SPDX-License-Identifier: GPL-2.0-or-later
flags := -g -O2 -Wall -Werror -I include/
heads := $(shell find include/ -name "*.h") examples/common.c
srcs := $(patsubst ./%,%,$(shell find src/ -name "*.c"))
objs := $(addsuffix .o,$(basename $(srcs)))
demos := examples/crc-ccitt
demos += examples/crc-ccittf
demos += examples/crc-itut
demos += examples/crc-rocksoft
demos += examples/crc-t10dif
demos += examples/crc4
demos += examples/crc7
demos += examples/crc8
demos += examples/crc16
demos += examples/crc32
demos += examples/crc64
all: $(demos)
%.o:%.c $(heads)
@ echo -e "\t\e[32mCC\e[0m\t" $@
@ gcc -o $@ -c $< $(flags)
$(demos): $(objs) $(addsuffix .c,$(demos))
@ echo -e "\t\e[34mMKELF\e[0m\t" $@
@ gcc -o $@ $@.c $(objs) $(flags)
clean: FORCE
@ echo -e "\t\e[31mCLEAN\e[0m\t" $@
@ rm -f $(demo) $(objs)
FORCE:
.PHONY: FORCE