
commit
afe4fd5ed0
9 changed files with 251 additions and 0 deletions
@ -0,0 +1,42 @@ |
|||||
|
BasedOnStyle: LLVM |
||||
|
ReflowComments: false |
||||
|
|
||||
|
MacroBlockBegin: "^BEGIN_OPERATOR" |
||||
|
MacroBlockEnd: "^END_OPERATOR" |
||||
|
|
||||
|
Language: Cpp |
||||
|
DerivePointerAlignment: true |
||||
|
SortIncludes: Never |
||||
|
PointerAlignment: Left |
||||
|
AlignAfterOpenBracket: AlwaysBreak |
||||
|
AlignOperands: AlignAfterOperator |
||||
|
AlignTrailingComments: true |
||||
|
AllowAllArgumentsOnNextLine: false |
||||
|
AllowAllParametersOfDeclarationOnNextLine: false |
||||
|
AllowShortEnumsOnASingleLine: false |
||||
|
AllowShortFunctionsOnASingleLine: Empty |
||||
|
AllowShortIfStatementsOnASingleLine: Never |
||||
|
AllowShortLoopsOnASingleLine: false |
||||
|
BinPackArguments: false |
||||
|
BinPackParameters: false |
||||
|
ExperimentalAutoDetectBinPacking: true |
||||
|
BreakBeforeBraces: Custom |
||||
|
BraceWrapping: |
||||
|
AfterFunction: true |
||||
|
ColumnLimit: 100 |
||||
|
AlwaysBreakAfterDefinitionReturnType: None |
||||
|
AlwaysBreakAfterReturnType: None |
||||
|
PenaltyBreakBeforeFirstCallParameter: 0 |
||||
|
PenaltyReturnTypeOnItsOwnLine: 1000000 |
||||
|
PenaltyBreakAssignment: 1000000 |
||||
|
PenaltyExcessCharacter: 10 |
||||
|
IndentCaseLabels: true |
||||
|
IndentWidth: 4 |
||||
|
MaxEmptyLinesToKeep: 2 |
||||
|
NamespaceIndentation: All |
||||
|
SpaceAfterTemplateKeyword: false |
||||
|
AccessModifierOffset: -4 |
||||
|
AllowShortBlocksOnASingleLine: Always |
||||
|
IndentPPDirectives: BeforeHash |
||||
|
IndentExternBlock: Indent |
||||
|
Cpp11BracedListStyle: false |
@ -0,0 +1,26 @@ |
|||||
|
# Build config |
||||
|
/build.conf |
||||
|
/.idea |
||||
|
|
||||
|
# Prerequisites |
||||
|
*.d |
||||
|
|
||||
|
# Object files |
||||
|
*.o |
||||
|
|
||||
|
# Precompiled Headers |
||||
|
*.gch |
||||
|
*.pch |
||||
|
|
||||
|
# Libraries |
||||
|
*.a |
||||
|
|
||||
|
# Executables |
||||
|
|
||||
|
# Debug files |
||||
|
*.dSYM/ |
||||
|
*.su |
||||
|
*.idb |
||||
|
*.pdb |
||||
|
|
||||
|
#Test |
@ -0,0 +1,21 @@ |
|||||
|
MIT License |
||||
|
|
||||
|
Copyright (c) 2017 Hundredrabbits |
||||
|
|
||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
|
of this software and associated documentation files (the "Software"), to deal |
||||
|
in the Software without restriction, including without limitation the rights |
||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
|
copies of the Software, and to permit persons to whom the Software is |
||||
|
furnished to do so, subject to the following conditions: |
||||
|
|
||||
|
The above copyright notice and this permission notice shall be included in all |
||||
|
copies or substantial portions of the Software. |
||||
|
|
||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
|
SOFTWARE. |
@ -0,0 +1,13 @@ |
|||||
|
.PHONY: all test src clean |
||||
|
|
||||
|
all: test src |
||||
|
|
||||
|
src: |
||||
|
$(MAKE) -C src |
||||
|
|
||||
|
test: |
||||
|
$(MAKE) -C test |
||||
|
|
||||
|
clean: |
||||
|
$(MAKE) -C src clean |
||||
|
$(MAKE) -C test clean |
@ -0,0 +1,80 @@ |
|||||
|
LIBNAME:=heck_log |
||||
|
LIB:=lib$(LIBNAME).a |
||||
|
|
||||
|
C_LANG_VERSION=c99 |
||||
|
CXX_LANG_VERSION=c++17 |
||||
|
|
||||
|
# Build option defaults
|
||||
|
PREFIX?=$(HOME)/local |
||||
|
SYS_PREFIX?=/opt/local |
||||
|
DEBUG?=1 |
||||
|
|
||||
|
COMPILE_FLAGS:= -MMD |
||||
|
|
||||
|
CFLAGS:=-std=$(C_LANG_VERSION) |
||||
|
CFLAGS+=\
|
||||
|
-finput-charset=UTF-8 \
|
||||
|
-Wpedantic \
|
||||
|
-Wextra \
|
||||
|
-Wwrite-strings \
|
||||
|
-Wconversion \
|
||||
|
-Wshadow \
|
||||
|
# -Wstrict-prototypes \
|
||||
|
# -Werror=implicit-function-declaration \
|
||||
|
-Werror=implicit-int \
|
||||
|
-Werror=incompatible-pointer-types \
|
||||
|
-Werror=int-conversion \
|
||||
|
-Wno-missing-field-initializers \
|
||||
|
|
||||
|
CXXFLAGS:=-std=$(CXX_LANG_VERSION) |
||||
|
CXXFLAGS+=\
|
||||
|
-fPIC \
|
||||
|
-Wall \
|
||||
|
-Wextra \
|
||||
|
-pedantic |
||||
|
|
||||
|
ifneq (,$(findstring g++,$(CXX))) |
||||
|
COMPILE_FLAGS+=-fdiagnostics-color=always |
||||
|
else ifneq (,$(findstring clang,$(CXX))) |
||||
|
COMPILE_FLAGS+=-fcolor-diagnostics |
||||
|
endif |
||||
|
|
||||
|
LIBS:=-lstdc++ |
||||
|
#-lpEpCxx11
|
||||
|
|
||||
|
LDFLAGS+=$(LIBS) |
||||
|
|
||||
|
######### Overrides from build.conf #########
|
||||
|
HERE:=$(dir $(lastword $(MAKEFILE_LIST))) |
||||
|
-include $(HERE)build.conf |
||||
|
|
||||
|
COMPILE_FLAGS+=-isystem$(SYS_PREFIX)/include |
||||
|
COMPILE_FLAGS+=-I$(PREFIX)/include |
||||
|
LDFLAGS+=-L$(SYS_PREFIX)/lib |
||||
|
LDFLAGS+=-L$(PREFIX)/lib |
||||
|
|
||||
|
ifeq ($(DEBUG),1) |
||||
|
COMPILE_FLAGS+=-g -O0 -DDEBUG |
||||
|
# -fsanitize=address \
|
||||
|
# -fsanitize=undefined \
|
||||
|
# -fsanitize=float-divide-by-zero \
|
||||
|
# -fsanitize=implicit-conversion \
|
||||
|
# -fsanitize=unsigned-integer-overflow
|
||||
|
else |
||||
|
COMPILE_FLAGS+=-DNDEBUG -O2 -g0 |
||||
|
endif |
||||
|
|
||||
|
ifeq ($(PORTMIDI_ENABLED),1) |
||||
|
COMPILE_FLAGS+= -DFEAT_PORTMIDI |
||||
|
LDFLAGS+= -lportmidi |
||||
|
endif |
||||
|
|
||||
|
ifeq ($(MOUSE_ENABLED),0) |
||||
|
COMPILE_FLAGS+=-DFEAT_NOMOUSE |
||||
|
endif |
||||
|
|
||||
|
CXXFLAGS+=$(COMPILE_FLAGS) |
||||
|
CFLAGS+=$(COMPILE_FLAGS) |
||||
|
|
||||
|
$(info C-Compiler: $(shell $(CC) --version)) |
||||
|
$(info C++-Compiler: $(shell $(CXX) --version)) |
@ -0,0 +1 @@ |
|||||
|
# Vulkan Hello World |
@ -0,0 +1,5 @@ |
|||||
|
# The following values reflect the defaults |
||||
|
# uncomment and adjust |
||||
|
|
||||
|
# DEBUG?=1 |
||||
|
# PREFIX=/opt/local |
@ -0,0 +1,32 @@ |
|||||
|
include ../Makefile.conf |
||||
|
|
||||
|
SRC:=$(wildcard *.c*) |
||||
|
SRC_EXE:=$(filter main_%, $(SRC)) |
||||
|
SRC_LIB=$(filter-out main_%, $(SRC)) |
||||
|
OBJS:=$(addsuffix .o, $(basename $(SRC))) |
||||
|
OBJS_LIB:=$(addsuffix .o, $(basename $(SRC_LIB))) |
||||
|
EXE:=$(basename $(SRC_EXE)) |
||||
|
DEPS:=$(addsuffix .d, $(basename $(SRC))) |
||||
|
|
||||
|
.PHONY: all install uninstall clean |
||||
|
.DEFAULT_GOAL:= all |
||||
|
|
||||
|
ifneq ($(MAKECMDGOALS),clean) |
||||
|
-include $(DEPS) |
||||
|
endif |
||||
|
|
||||
|
all: $(EXE) |
||||
|
|
||||
|
$(LIB): $(OBJS) |
||||
|
$(AR) -rc $@ $(OBJS_LIB) |
||||
|
|
||||
|
$(EXE) : $(LIB) |
||||
|
|
||||
|
clean: |
||||
|
rm -rf \
|
||||
|
$(OBJS) \
|
||||
|
$(EXE) \
|
||||
|
$(LIB) \
|
||||
|
*.d \
|
||||
|
*.dSYM \
|
||||
|
*.h.gch |
@ -0,0 +1,31 @@ |
|||||
|
include ../Makefile.conf |
||||
|
|
||||
|
SRC:=$(wildcard *.c*) |
||||
|
SRC_EXE:=$(filter test_%, $(SRC)) |
||||
|
EXE:=$(basename $(SRC_EXE)) |
||||
|
|
||||
|
$(info src exe: $(SRC_EXE)) |
||||
|
$(info lib: $(LIB)) |
||||
|
$(info exe: $(EXE)) |
||||
|
|
||||
|
LDFLAGS+=-L../src |
||||
|
CFLAGS+=-I../src |
||||
|
CXXFLAGS+=-I../src |
||||
|
|
||||
|
.PHONY: lib all clean ../src/$(LIB) |
||||
|
.DEFAULT_GOAL := all |
||||
|
|
||||
|
all: $(EXE) |
||||
|
|
||||
|
../src/$(LIB): |
||||
|
$(MAKE) -C ../src $(LIB) |
||||
|
|
||||
|
$(EXE): ../src/$(LIB) |
||||
|
|
||||
|
clean: |
||||
|
rm -rf \
|
||||
|
$(OBJS) \
|
||||
|
$(EXE) \
|
||||
|
*.d \
|
||||
|
*.dSYM \
|
||||
|
*.h.gch |
Loading…
Reference in new issue