-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial push for refactor new CrossDB
- Loading branch information
Showing
67 changed files
with
14,454 additions
and
1,232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
help: | ||
@echo "make build Build crossdb library and tool" | ||
@echo "make debug Build crossdb library and tool with debug" | ||
@echo "make run Run crossdb tool" | ||
@echo "make clean Clean build result" | ||
@echo "make install Install crossdb(lib&tool&header) to Linux & FreeBSD" | ||
@echo "make uninstall Uninstall crossdb from Linux & FreeBSD" | ||
@echo "make installmacos Install crossdb(lib&tool&header) to MacOS" | ||
@echo "make uninstallmacos Uninstall crossdb from MacOS" | ||
@echo "make example Build and run example (need to install crossdb first)" | ||
@echo "make bench Build and run bench test (need to install crossdb first)" | ||
|
||
.PHONY: build | ||
build: | ||
$(CC) -o build/libcrossdb.so -fPIC -shared -lpthread -O2 src/crossdb.c | ||
$(CC) -o build/crossdb src/main.c -lpthread -O2 | ||
cp src/crossdb.h build/ | ||
|
||
debug: | ||
$(CC) -o build/libcrossdb.so -fPIC -lpthread -shared -g src/crossdb.c | ||
$(CC) -o build/crossdb src/main.c -lpthread -g | ||
cp src/crossdb.h build/ | ||
|
||
run: | ||
build/crossdb | ||
|
||
clean: | ||
rm -rf build/* | ||
make -C examples/c/ clean | ||
make -C bench/c/ clean | ||
|
||
wall: | ||
$(CC) -o build/libcrossdb.so -fPIC -shared -lpthread -O2 -Wall src/crossdb.c | ||
$(CC) -o build/crossdb src/main.c -lpthread -O2 -Wall | ||
cp src/crossdb.h build/ | ||
|
||
gdb: | ||
$(CC) -o build/crossdb src/main.c -lpthread -g | ||
gdb build/crossdb | ||
|
||
install: | ||
install -c build/libcrossdb.so /usr/lib/ | ||
install -c build/crossdb.h /usr/include/ | ||
install -c build/crossdb /usr/bin/ | ||
|
||
uninstall: | ||
rm -rf /usr/lib/libcrossdb.so | ||
rm -rf /usr/include/crossdb.h | ||
rm -rf /usr/bin/crossdb | ||
|
||
installmacos: | ||
$(CC) -o build/libcrossdb.so -dynamiclib -lpthread -O2 src/crossdb.c | ||
install -c build/libcrossdb.so /usr/local/lib/ | ||
install -c build/crossdb.h /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include | ||
install -c build/crossdb /usr/local/bin/ | ||
|
||
uninstallmacos: | ||
rm -rf /usr/local/lib/libcrossdb.so | ||
rm -rf /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/crossdb.h | ||
rm -rf /usr/local/bin/crossdb | ||
|
||
example: | ||
make -C examples/c/ | ||
|
||
.PHONY: bench | ||
bench: | ||
make -C bench/c/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: | ||
$(CC) bench.c -O2 -lcrossdb -lpthread | ||
./a.out | ||
|
||
fast: | ||
$(CC) bench.c ../../src/crossdb.c -O3 -march=native | ||
./a.out | ||
|
||
clean: | ||
rm -f a.out |
Oops, something went wrong.