ICFS/Makefile

36 lines
893 B
Makefile
Raw Normal View History

SHELL=/bin/bash
2024-11-17 20:21:56 +01:00
CC := gcc
CXX := g++
CFLAGS := -I/usr/include/fuse -D_FILE_OFFSET_BITS=64
LDFLAGS := -lfuse3 -pthread
ifdef DEBUG
CFLAGS += -O0 -pedantic -Wall -Wextra -Wcast-align \
-Wcast-qual -Wdisabled-optimization -Wformat=2 \
-Winit-self -Wlogical-op -Wmissing-declarations \
-Wmissing-include-dirs -Wredundant-decls -Wshadow \
-Wsign-conversion -Wstrict-overflow=5 \
-Wswitch-default -Wundef -Wno-unused
LDFLAGS +=
else
CFLAGS += -O3
LDFLAGS +=
endif
2024-11-17 20:21:56 +01:00
SOURCES_DIR := ./sources
BUILD_DIR := ./build
build: $(BUILD_DIR)/main.o $(BUILD_DIR)/sourcefs.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/icfs
$(BUILD_DIR)/main.o: $(SOURCES_DIR)/main.c
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $(BUILD_DIR)/main.o
2024-11-17 20:21:56 +01:00
$(BUILD_DIR)/sourcefs.o: $(SOURCES_DIR)/sourcefs.c $(SOURCES_DIR)/sourcefs.h
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $@
2024-11-18 17:44:00 +01:00
clean:
rm $(BUILD_DIR)/*