summaryrefslogtreecommitdiff
path: root/crc/Makefile
blob: 0922163da31b6baf2e793ce211a1b039e7ba5d89 (plain)
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
# SPDX-License-Identifier: CC0-1.0

CROSS_COMPILE ?=

CC	:= $(CROSS_COMPILE)gcc
CFLAGS	?= -O2 -W -Wall -Wno-unused-parameter -Iinclude
LDFLAGS	?=
LIBS	:=

OUTPUT	:= discom-crc
OBJECTS	:= main.o

%.o : %.c
	$(CC) $(CFLAGS) -c -o $@ $<

all: $(OUTPUT)

$(OUTPUT): $(OBJECTS)
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

crc.c : gen-crc.py
	./$< $@

main.o : crc.c

clean:
	-rm -f *.o
	-rm -f crc.c
	-rm -f $(OUTPUT)

install:
	cp $(OUTPUT) $(INSTALL_DIR)/