blob: 4a4ab885cfb75f3affa0103b2c17bed17a9d74e0 (
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
33
|
#
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# See LICENSE.txt for license information
#
# Prerequisite: $(FILESTOFORMAT) contains the list of files of interest for formatting
# As this file defines a new target (format), it should be included at least after the definition of the
# default target.
ASTYLE_FORMAT_OPTS=-Qv --style=java --indent-after-parens --indent-modifiers --indent-switches --indent-continuation=2 --keep-one-line-blocks --keep-one-line-statements --indent=spaces=2 --lineend=linux --suffix=none
ASTYLEDIR := $(BUILDDIR)/contrib
ASTYLETAR := $(ASTYLEDIR)/astyle.tar.gz
ASTYLEBIN := $(ASTYLEDIR)/astyle/build/gcc/bin/astyle
ASTYLEBLD := $(ASTYLEDIR)/astyle/build/gcc/
ASTYLEVER := 3.1
ASTYLEURL := "https://versaweb.dl.sourceforge.net/project/astyle/astyle/astyle%20$(ASTYLEVER)/astyle_$(ASTYLEVER)_linux.tar.gz"
$(ASTYLEDIR) :
@mkdir -p $(ASTYLEDIR)
$(ASTYLETAR) : $(ASTYLEDIR)
@wget -q -O $(ASTYLETAR) $(ASTYLEURL)
$(ASTYLEBLD) : $(ASTYLETAR)
@cd $(ASTYLEDIR) && tar xzf $(ASTYLETAR)
$(ASTYLEBIN) : $(ASTYLEBLD)
${MAKE} -C $(ASTYLEBLD)
.PHONY : format
format : $(ASTYLEBIN)
@$(ASTYLEBIN) $(ASTYLE_FORMAT_OPTS) $(FILESTOFORMAT)
|