Compare commits

..

No commits in common. "f4576cf7ea3315627ceb58c07c205e13d4ea410d" and "112d514f59f61d02b19f48653ee97e7cf4e740f1" have entirely different histories.

5 changed files with 21 additions and 56 deletions

5
.gitignore vendored
View File

@ -3,9 +3,6 @@ build/*
.cache .cache
test/protected/* test/protected/*
test/.pt.db test/.pt.db
*compile_commands.json compile_commands.json
test/perf* test/perf*
test/callgraph* test/callgraph*
src/gui/ui/*
src/gui/*.o
src/gui/icfs_dialogue

View File

@ -2,17 +2,9 @@ SHELL=/bin/bash
# configurable options # configurable options
ifndef ($(SOURCES_DIR)) SOURCES_DIR := ./src
SOURCES_DIR := ./src TESTS_DIR := ./tests
endif BUILD_DIR := ./build
ifndef ($(TESTS_DIR))
TESTS_DIR := ./tests
endif
ifndef ($(BUILD_DIR))
BUILD_DIR := ./build
endif
CC := gcc CC := gcc
CXX := g++ CXX := g++
@ -57,18 +49,12 @@ ifeq ($(TEST), 1)
TARGETS += icfs_test TARGETS += icfs_test
endif endif
ifneq ($(DIALOGUE), 0)
TARGETS += $(BUILD_DIR)/icfs_dialogue
endif
# build! # build!
default: $(TARGETS) default: $(TARGETS)
.PHONY: clean icfs_test clean-icfs clean-icfs_dialogue .PHONY: clean
$(BUILD_DIR)/icfs_dialogue:
make -C $(SOURCES_DIR)/gui TEST=$(TEST) DEBUG=$(shell realpath $(DEBUG)) SOURCES_DIR=$(shell realpath $(SOURCES_DIR)/gui) BUILD_DIR=$(shell realpath $(BUILD_DIR)) TESTS_DIR=$(shell realpath $(TESTS_DIR))
$(BUILD_DIR)/icfs: $(BUILD_DIR)/main.o $(BUILD_DIR)/fuse_operations.o $(BUILD_DIR)/sourcefs.o $(BUILD_DIR)/ui-socket.o $(BUILD_DIR)/temp_permissions_table.o $(BUILD_DIR)/perm_permissions_table.o $(BUILD_DIR)/icfs: $(BUILD_DIR)/main.o $(BUILD_DIR)/fuse_operations.o $(BUILD_DIR)/sourcefs.o $(BUILD_DIR)/ui-socket.o $(BUILD_DIR)/temp_permissions_table.o $(BUILD_DIR)/perm_permissions_table.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/icfs $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/icfs
@ -97,16 +83,6 @@ $(BUILD_DIR)/temp_permissions_table.o: $(SOURCES_DIR)/temp_permissions_table.c $
$(BUILD_DIR)/perm_permissions_table.o: $(SOURCES_DIR)/perm_permissions_table.c $(SOURCES_DIR)/perm_permissions_table.h $(BUILD_DIR)/perm_permissions_table.o: $(SOURCES_DIR)/perm_permissions_table.c $(SOURCES_DIR)/perm_permissions_table.h
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $@ $(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $@
CLEAN_TARGETS=clean-icfs
ifneq ($(DIALOGUE), 0) clean:
CLEAN_TARGETS += clean-icfs_dialogue rm $(BUILD_DIR)/*.o $(BUILD_DIR)/icfs*
endif
clean: $(CLEAN_TARGETS)
clean-icfs:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/icfs
clean-icfs_dialogue:
make -C $(SOURCES_DIR)/gui clean SOURCES_DIR=$(shell realpath $(SOURCES_DIR)/gui) BUILD_DIR=$(shell realpath $(BUILD_DIR)) TESTS_DIR=$(shell realpath $(TESTS_DIR))

View File

@ -2,17 +2,9 @@ SHELL=/bin/bash
# configurable options # configurable options
ifndef ($(SOURCES_DIR)) SOURCES_DIR := .
SOURCES_DIR := . TESTS_DIR := .
endif BUILD_DIR := .
ifndef ($(TESTS_DIR))
TESTS_DIR := .
endif
ifndef ($(BUILD_DIR))
BUILD_DIR := .
endif
CC := gcc CC := gcc
CXX := g++ CXX := g++
@ -51,10 +43,10 @@ endif
# set up targets # set up targets
TARGETS := $(BUILD_DIR)/icfs_dialogue TARGETS := $(BUILD_DIR)/zenity
ifeq ($(TEST), 1) ifeq ($(TEST), 1)
TARGETS += icfs_dialogue_test TARGETS += zenity_test
endif endif
@ -62,16 +54,16 @@ endif
default: $(TARGETS) default: $(TARGETS)
.PHONY: clean icfs_dialogue_test .PHONY: clean zenity_test
icfs_dialogue_test: $(BUILD_DIR)/icfs_dialogue zenity_test: $(BUILD_DIR)/zenity
$(BUILD_DIR)/icfs_dialogue 666 cat /home/fedir /Downloads ./zenity 666 cat /home/fedir Downloads
$(BUILD_DIR)/icfs_dialogue: $(BUILD_DIR)/icfs_dialogue.o $(BUILD_DIR)/zenity: $(BUILD_DIR)/zenity.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/icfs_dialogue $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/zenity
$(BUILD_DIR)/icfs_dialogue.o: $(SOURCES_DIR)/icfs_dialogue.c $(BUILD_DIR)/zenity.o: $(SOURCES_DIR)/zenity-clone.c
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $(BUILD_DIR)/icfs_dialogue.o $(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $(BUILD_DIR)/zenity.o
clean: clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/icfs_dialogue rm $(BUILD_DIR)/*.o $(BUILD_DIR)/zenity

View File

@ -28,7 +28,7 @@ if [[ $1 == "--setuid" ]]; then
else else
echo "Database protection will not be tested due to the lack of setuid capabilites." echo "Database protection will not be tested due to the lack of setuid capabilites."
echo "To test it, run this script with '--setuid'." echo "To test it, run this script with '--setuid'."
valgrind --leak-check=full -s ../build/icfs -o default_permissions ./protected ./.pt.db & valgrind -s ../build/icfs -o default_permissions ./protected ./.pt.db &
sleep 5 sleep 5
fi fi