@@ -25,7 +25,7 @@ CC = gcc
25
25
CXXFLAGS = -c -g -W -Waggregate-return -Wall -Werror -Wcast-align -Wcast-qual -Wchar-subscripts
26
26
CXXFLAGS += -Wcomment -Wformat -Wmissing-declarations -Wparentheses -Wpointer-arith -Wredundant-decls
27
27
CXXFLAGS += -Wreturn-type -Wshadow -Wswitch -Wtrigraphs -Wwrite-strings -O
28
- CXXFLAGS += -fno-inline-functions-called-once -fPIC -Wuninitialized -Wunused -march=x86-64 -I.
28
+ CXXFLAGS += -fno-inline-functions-called-once -fPIC -Wuninitialized -Wunused -march=x86-64 -I. -Isrc
29
29
CFLAGS = -Wimplicit -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -std=gnu99
30
30
ifneq ($(filter debug,$(MAKECMDGOALS ) ) ,)
31
31
BUILD_TYPE = debug
@@ -36,23 +36,23 @@ BUILD_TYPE = release
36
36
BUILD_TYPE_NODE = Release
37
37
CXXFLAGS += -O3
38
38
endif
39
- DEPS_H = $(wildcard * .h)
40
- DEPS_HPP = $(wildcard * .hpp)
41
- NODE_SRCS = $(filter-out % build,$(wildcard ./wrappers/nodejs/* ) )
42
- PROD_SRCS_C = $(filter-out test% ,$(wildcard * .c) )
43
- PROD_SRCS_C = $(filter-out main% ,$(wildcard * .c) )
44
- PROD_OBJS_C = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter-out test% ,$(patsubst % .c,% .o,$(PROD_SRCS_C ) ) ) )
45
- PROD_SRCS_CPP = $(filter-out test% ,$(wildcard * .cpp) )
46
- PROD_OBJS_CPP = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter-out test% ,$(patsubst % .cpp,% .o,$(PROD_SRCS_CPP ) ) ) )
47
- MAIN_SRCS_C = $(filter main% ,$(wildcard * .c) )
48
- MAIN_OBJS_C = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter main% ,$(patsubst % .c,% .o,$(MAIN_SRCS_C ) ) ) )
49
- MAIN_EXES = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter % ,$(patsubst main.% .c,% ,$(MAIN_SRCS_C ) ) ) )
50
- TEST_SRCS_C = $(filter test% ,$(wildcard * .c) )
51
- TEST_OBJS_C = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter test% ,$(patsubst % .c,% .o,$(TEST_SRCS_C ) ) ) )
52
- TEST_SRCS_CPP = $(filter test% ,$(wildcard * .cpp) )
53
- TEST_OBJS_CPP = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter test% ,$(patsubst % .cpp,% .o,$(TEST_SRCS_CPP ) ) ) )
54
- TEST_EXES = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter test% ,$(patsubst % .c,% .t,$(TEST_SRCS_C ) ) ) ) \
55
- $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter test% ,$(patsubst % .cpp,% .t,$(TEST_SRCS_CPP ) ) ) )
39
+ DEPS_H = $(wildcard ./src/ * .h)
40
+ DEPS_HPP = $(wildcard ./src/ * .hpp)
41
+ NODE_SRCS = $(filter-out % build,$(wildcard ./wrappers/nodejs/* ) )
42
+ PROD_SRCS_C = $(filter-out ./src/ test% ,$(wildcard ./src/ * .c) )
43
+ PROD_SRCS_C = $(filter-out ./src/ main% ,$(wildcard ./src/ * .c) )
44
+ PROD_OBJS_C = $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter-out ./src/ test% ,$(patsubst % .c,% .o,$(PROD_SRCS_C ) ) ) )
45
+ PROD_SRCS_CPP = $(filter-out ./src/ test% ,$(wildcard ./src/ * .cpp) )
46
+ PROD_OBJS_CPP = $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter-out ./src/ test% ,$(patsubst % .cpp,% .o,$(PROD_SRCS_CPP ) ) ) )
47
+ MAIN_SRCS_C = $(filter ./src/ main% ,$(wildcard ./src/ * .c) )
48
+ MAIN_OBJS_C = $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter ./src/ main% ,$(patsubst % .c,% .o,$(MAIN_SRCS_C ) ) ) )
49
+ MAIN_EXES = $(patsubst % ,$(BUILD_TYPE ) /% ,$(filter % ,$(patsubst ./src/ main.% .c,% ,$(MAIN_SRCS_C ) ) ) )
50
+ TEST_SRCS_C = $(filter ./src/ test% ,$(wildcard ./src/ * .c) )
51
+ TEST_OBJS_C = $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter ./src/ test% ,$(patsubst % .c,% .o,$(TEST_SRCS_C ) ) ) )
52
+ TEST_SRCS_CPP = $(filter ./src/ test% ,$(wildcard ./src/ * .cpp) )
53
+ TEST_OBJS_CPP = $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter ./src/ test% ,$(patsubst % .cpp,% .o,$(TEST_SRCS_CPP ) ) ) )
54
+ TEST_EXES = $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter ./src/ test% ,$(patsubst % .c,% .t,$(TEST_SRCS_C ) ) ) ) \
55
+ $(patsubst ./src/ % ,$(BUILD_TYPE ) /% ,$(filter ./src/ test% ,$(patsubst % .cpp,% .t,$(TEST_SRCS_CPP ) ) ) )
56
56
57
57
ifneq ($(filter clean,$(MAKECMDGOALS ) ) ,)
58
58
else
@@ -88,11 +88,11 @@ all: tab $(MAIN_EXES) $(TEST_EXES) $(BUILD_TYPE)/SharedHashFile.a $(BUILD_TYPE)/
88
88
@echo " make: note: prefix make with SHF_PERFORMANCE_TEST_(ENABLE|CPUS|KEYS)=(1|4|10000000) to run perf test"
89
89
@echo " make: built and tested $( BUILD_TYPE) version"
90
90
91
- $(BUILD_TYPE ) /% .o : % .c $(DEPS_H )
91
+ $(BUILD_TYPE ) /% .o : ./src/ % .c $(DEPS_H )
92
92
@echo " make: compiling: $@ "
93
93
@$(CC ) -o $@ $< $(CXXFLAGS ) $(CFLAGS )
94
94
95
- $(BUILD_TYPE ) /% .o : % .cpp $(DEPS_H ) $(DEPS_HPP )
95
+ $(BUILD_TYPE ) /% .o : ./src/ % .cpp $(DEPS_H ) $(DEPS_HPP )
96
96
@echo " make: compiling: $@ "
97
97
@$(CC ) -o $@ $< $(CXXFLAGS )
98
98
@@ -123,7 +123,7 @@ ifneq ($(findstring node-gyp,$(NODE_GYP)),)
123
123
@cd $(BUILD_TYPE) && NODE_DEBUG=mymod nodejs ./SharedHashFileDummy.js
124
124
@echo "make: building and running test: IPC: Unix Domain Socket"
125
125
@cd $(BUILD_TYPE) && cp ../wrappers/nodejs/TestIpcSocket.* .
126
- @cd $(BUILD_TYPE) && gcc -o TestIpcSocket.o $(CFLAGS) $(CXXFLAGS) -I .. TestIpcSocket.c
126
+ @cd $(BUILD_TYPE) && gcc -o TestIpcSocket.o $(CFLAGS) $(CXXFLAGS) -I ../src TestIpcSocket.c
127
127
@cd $(BUILD_TYPE) && gcc -o TestIpcSocket TestIpcSocket.o shf.o murmurhash3.o
128
128
@cd $(BUILD_TYPE) && ./TestIpcSocket
129
129
@echo "make: running test: IPC: SharedHashFile Queue"
0 commit comments