This repository has been archived on 2024-05-05. You can view files and clone it, but cannot push or open issues or pull requests.
work-stealing-scheduler/Makefile

74 lines
1.5 KiB
Makefile
Raw Normal View History

2024-03-15 12:19:51 +01:00
CC = gcc
RM = rm -rf
2024-05-03 20:26:04 +02:00
TAR = tar -czf
2024-03-15 12:19:51 +01:00
CP = cp -r
MKDIR = mkdir -p
SRC_DIR = src
INC_DIR = includes
SOURCES = $(wildcard $(SRC_DIR)/*.c)
SOURCES_NOSCHED = $(filter-out $(wildcard $(SRC_DIR)/sched-*.c), $(SOURCES))
ALL_OBJECTS = $(patsubst %.c,%.o,$(notdir $(SOURCES)))
OBJECTS = $(patsubst %.c,%.o,$(notdir $(SOURCES_NOSCHED)))
CFLAGS = -std=gnu11 -pedantic
LDFLAGS =
SCHED = sched-ws.o
2024-03-15 12:32:26 +01:00
EXE = ordonnanceur
2024-03-26 20:50:32 +01:00
EXE_EXT = .elf
2024-04-20 21:23:40 +02:00
ARCHIVE_NAME = kennel
PDF_DIR = report
PDF_NEWNAME = Rapport de projet
%.o: src/%.c
$(CC) -c $< -o $@ $(CFLAGS)
release: CFLAGS += -O2
2024-04-18 22:37:23 +02:00
release: compilation
2024-04-17 16:00:32 +02:00
debug: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes
debug: CFLAGS += -fanalyzer -fsanitize=undefined -g -Og
debug: LDFLAGS += -fsanitize=undefined -fsanitize=thread
2024-04-17 16:00:32 +02:00
debug: compilation
compilation: $(ALL_OBJECTS)
$(CC) -o $(EXE)$(EXE_EXT) $(OBJECTS) $(SCHED) $(LDFLAGS)
2024-04-18 22:37:23 +02:00
all:
2024-04-18 22:37:23 +02:00
release
# Specific schedulers
threads: SCHED = sched-threads.o
threads: release
2024-04-24 17:14:34 +02:00
lifo: SCHED = sched-lifo.o
lifo: release
random: SCHED = sched-random.o
random: release
ws: SCHED = sched-ws.o
ws: release
pdf-make:
cd report && \
$(MAKE)
pdf-clean:
2024-04-21 12:03:46 +02:00
-@cd report && \
$(MAKE) clean
clean: pdf-clean
2024-05-03 20:26:04 +02:00
$(RM) $(ALL_OBJECTS) "$(EXE)$(EXE_EXT)" "$(ARCHIVE_NAME).tar.gz"
archive: pdf-make
2024-04-20 21:23:40 +02:00
$(MKDIR) "$(ARCHIVE_NAME)"
$(CP) "$(SRC_DIR)" "$(INC_DIR)" Makefile README "$(ARCHIVE_NAME)"
$(CP) "$(wildcard $(PDF_DIR)/*.pdf)" "$(ARCHIVE_NAME)/$(PDF_NEWNAME).pdf"
2024-05-03 20:26:04 +02:00
$(TAR) "$(ARCHIVE_NAME).tar.gz" "$(ARCHIVE_NAME)"
2024-04-20 21:23:40 +02:00
$(RM) "$(ARCHIVE_NAME)"