Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CMake for automating the build process
With subsequent directory structure reorganization.
- Loading branch information
Showing
14 changed files
with
30 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
/phpfs | ||
*.o | ||
/build-*/ |
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 |
---|---|---|
@@ -1,31 +1,17 @@ | ||
.PHONY: clean mount umount reload | ||
CFLAGS=-g -Wall -DDEBUG `pkg-config --cflags fuse` -DFUSE_USE_VERSION=29 | ||
LDFLAGS=-lfuse -lcurl | ||
release debug: build | ||
|
||
# EXE ]------------------------------------------------------------------------- | ||
release: BUILD_DIR=./build-release/ | ||
release: BUILD_TYPE=Release | ||
|
||
phpfs: main.o phpfs.o net.o $(patsubst %.c,%.o,$(wildcard fuse_api/*.c)) | ||
debug: BUILD_DIR=./build-debug/ | ||
debug: BUILD_TYPE=Debug | ||
|
||
# OBJECTS ]--------------------------------------------------------------------- | ||
|
||
# generated by: gcc -D_FILE_OFFSET_BITS=64 -MM *.c | ||
main.o: main.c phpfs.h debug.h net.h | ||
net.o: net.c phpfs.h debug.h net.h | ||
phpfs.o: phpfs.c phpfs.h debug.h net.h fuse_api/fuse_api.h | ||
|
||
# UTILS ]----------------------------------------------------------------------- | ||
build: | ||
rm -fr $(BUILD_DIR) | ||
mkdir -p $(BUILD_DIR) | ||
cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) ../src/ && make | ||
|
||
clean: | ||
find -name '*.o' -delete | ||
rm -f ./phpfs | ||
|
||
# TEST ]------------------------------------------------------------------------ | ||
|
||
mount: | ||
test -d /tmp/phpfs || mkdir /tmp/phpfs/ | ||
./phpfs 'http://localhost/phpfs/phpfs.php' /tmp/phpfs/ | ||
|
||
umount: | ||
fusermount -u /tmp/phpfs/ | ||
rm -fr ./build-release/ ./build-debug/ | ||
|
||
reload: umount mount | ||
.PHONY: build build-release build-debug clean |
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,16 @@ | ||
cmake_minimum_required( VERSION 2.8 ) | ||
find_package( PkgConfig ) | ||
|
||
project( phpfs ) | ||
|
||
file( GLOB fuse_api fuse_api/*.c ) | ||
file( GLOB core *.c ) | ||
add_executable( phpfs ${core} ${fuse_api} ) | ||
|
||
add_definitions( -Wall ) | ||
|
||
find_package( CURL ) | ||
pkg_check_modules( FUSE REQUIRED fuse ) | ||
add_definitions( ${FUSE_CFLAGS} -DFUSE_USE_VERSION=29 ) | ||
|
||
target_link_libraries( phpfs ${CURL_LIBRARY} ${FUSE_LIBRARIES} ) |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef _PHPFS_DEBUG_H | ||
#define _PHPFS_DEBUG_H | ||
|
||
#ifdef DEBUG | ||
#ifndef NDEBUG | ||
|
||
#include <stdio.h> | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.