Makefile 817 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# Copyright (C) 2020 CERN

# If it exists includes Makefile.specific. In this Makefile, you should put
# specific Makefile code that you want to run before this. For example,
# build a particular environment.
-include Makefile.specific

DESTDIR ?= /usr/local/

TOOLS = spec-firmware-version

14 15
INCLUDE := -I. -I../kernel -I../include/uapi
CFLAGS = -ggdb $(INCLUDE) -Wall -Werror $(EXTRACFLAGS)
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
GIT_VERSION := $(shell git describe --dirty --long --tags)
CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""

CPPCHECK ?= cppcheck

all: $(TOOLS)


$(TOOLS):

clean:
	rm -f $(TOOLS)

install:
	install -d $(DESTDIR)/bin
	install -D $(TOOLS) $(DESTDIR)/bin

cppcheck:
34
	$(CPPCHECK) -q $(INCLUDE) --suppress=missingIncludeSystem --enable=all *.c *.h  --error-exitcode=1
35 36

.PHONY=cppcheck