Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
* added generic format targets to the build system
* set formatting paths in the Makefile settings
* related to sealangdotorg/sea#52
  • Loading branch information
ppaulweber committed Nov 26, 2017
1 parent c50b235 commit 2821306
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .cmake/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ $(INSTA):%-install: %
@$(MAKE) $(MFLAGS) --no-print-directory -C $(OBJ) install


format: $(FORMAT:%=%-format-cpp)

%-format-cpp:
@echo "-- Formatting Code C++: $(patsubst %-format-cpp,%,$@)"
@clang-format -i \
`ls $(patsubst %-format-cpp,%,$@)/*.h 2> /dev/null | grep -e .h` 2> /dev/null
@clang-format -i \
`ls $(patsubst %-format-cpp,%,$@)/*.cpp 2> /dev/null | grep -e .cpp` 2> /dev/null


analyze: debug-analyze

analyze-all: $(TYPES:%=%-analyze)
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,14 @@

TARGET = libstdhl

FORMAT = src/cpp
FORMAT += src/cpp/file
FORMAT += src/cpp/log
FORMAT += src/cpp/network
FORMAT += src/cpp/network/*
FORMAT += src/cpp/standard
FORMAT += src/cpp/type
FORMAT += etc/test/cpp
FORMAT += etc/test/cpp/*

include .cmake/config.mk

0 comments on commit 2821306

Please sign in to comment.