Add include dir and -I./include for headers
This commit is contained in:
parent
eea814ed48
commit
0fd88fcee9
2 changed files with 55 additions and 12 deletions
45
Makefile
45
Makefile
|
|
@ -93,18 +93,41 @@ OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC))
|
||||||
# -D_FORTIFY_SOURCE=2 -O2 # buffer overflow check. -D_FORTIFY_SOURCE=1 also possible
|
# -D_FORTIFY_SOURCE=2 -O2 # buffer overflow check. -D_FORTIFY_SOURCE=1 also possible
|
||||||
# -Wfloat-equal # testing floating-point numbers for equality is usually bad
|
# -Wfloat-equal # testing floating-point numbers for equality is usually bad
|
||||||
# -Wpointer-arith # warn if anything depends upon the size of a function or of void
|
# -Wpointer-arith # warn if anything depends upon the size of a function or of void
|
||||||
_CXXFLAGS=-Wall -Wextra \
|
##_CXXFLAGS=-Wall -Wextra \
|
||||||
-Wconversion -Wsign-conversion \
|
## -Wconversion -Wsign-conversion \
|
||||||
-march=x86-64 \
|
## -march=x86-64 \
|
||||||
-Wformat-security \
|
## -Wformat-security \
|
||||||
-fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 \
|
## -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 \
|
||||||
-ftrapv \
|
## -ftrapv \
|
||||||
-D_FORTIFY_SOURCE=2 -O2 \
|
## -D_FORTIFY_SOURCE=2 -O2 \
|
||||||
-Wfloat-equal \
|
## -Wfloat-equal \
|
||||||
-Wpointer-arith
|
## -Wpointer-arith
|
||||||
|
_CXXFLAGS=-Wall -Weffc++ -pedantic \
|
||||||
|
-pedantic-errors -Waggregate-return -Wcast-align \
|
||||||
|
-Wcast-qual -Wchar-subscripts -Wcomment \
|
||||||
|
-Wdisabled-optimization \
|
||||||
|
-Wformat -Wformat=2 \
|
||||||
|
-Wformat-nonliteral -Wformat-security \
|
||||||
|
-Wformat-y2k \
|
||||||
|
-Wimport -Winit-self -Winline \
|
||||||
|
-Winvalid-pch \
|
||||||
|
-Wlong-long -Wmissing-braces \
|
||||||
|
-Wmissing-format-attribute \
|
||||||
|
-Wmissing-include-dirs -Wmissing-noreturn \
|
||||||
|
-Wpacked -Wparentheses -Wpointer-arith \
|
||||||
|
-Wredundant-decls -Wreturn-type \
|
||||||
|
-Wsequence-point -Wshadow -Wsign-compare -fstack-protector-all -Wstack-protector \
|
||||||
|
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default \
|
||||||
|
-Wswitch-enum -Wtrigraphs \
|
||||||
|
-Wunknown-pragmas -Wunreachable-code \
|
||||||
|
-Wvariadic-macros \
|
||||||
|
-Wvolatile-register-var -Wwrite-strings\
|
||||||
|
-Werror=return-type \
|
||||||
|
-Werror=narrowing \
|
||||||
|
-ftrapv -Wfloat-equal -Wpointer-arith \
|
||||||
|
-D_FORTIFY_SOURCE=2 -O2
|
||||||
|
|
||||||
|
CXXFLAGS = $(NETBEANSBUILD) $(DBG_REL) $(_CXXFLAGS) -I./include/
|
||||||
CXXFLAGS = $(NETBEANSBUILD) $(DBG_REL) $(_CXXFLAGS)
|
|
||||||
LIBS = $(NETBEANSBUILD)
|
LIBS = $(NETBEANSBUILD)
|
||||||
|
|
||||||
# Uncomment one of the following to select an output format
|
# Uncomment one of the following to select an output format
|
||||||
|
|
|
||||||
20
include/add.h
Executable file
20
include/add.h
Executable file
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/file.h to edit this template
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File: add.h
|
||||||
|
* Author: benn
|
||||||
|
*
|
||||||
|
* Created on February 24, 2023, 11:07 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ADD_H
|
||||||
|
#define ADD_H
|
||||||
|
|
||||||
|
int add(int x, int y);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* ADD_H */
|
||||||
|
|
||||||
Loading…
Reference in a new issue