Skip to content
Snippets Groups Projects
Commit 0c8f023c authored by ERKEN EFE's avatar ERKEN EFE
Browse files

:sparkles: NEW: Introduce new directory structure

Introducing organized folder structure and config changes to go along.
parents 1f735918 b6372af7
Branches
Tags
No related merge requests found
*.o
*.s
*.a
*.d
*.Td
*.lib
*.so
*.dylib
......@@ -12,7 +14,6 @@
.DS_STORE
*.exe
a.out
html
latex
doc/doxygen/
sokoban
sokoban_test
......@@ -38,13 +38,13 @@ PROJECT_NAME = "Sokoban"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 1.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
PROJECT_BRIEF = "Le fameux jeu Sokoban, poussez les boîtes !"
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
......@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY = doc/doxygen/
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
......@@ -158,7 +158,7 @@ INLINE_INHERITED_MEMB = NO
# shortest path that makes the file name unique will be used
# The default value is: YES.
FULL_PATH_NAMES = YES
FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand
......@@ -491,7 +491,7 @@ EXTRACT_PACKAGE = NO
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = NO
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
......@@ -829,7 +829,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT =
INPUT = src/ include/ README.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......@@ -970,7 +970,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH =
IMAGE_PATH = images/
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
......@@ -1026,7 +1026,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
USE_MDFILE_AS_MAINPAGE = README.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
......@@ -1039,7 +1039,7 @@ USE_MDFILE_AS_MAINPAGE =
# also VERBATIM_HEADERS is set to NO.
# The default value is: NO.
SOURCE_BROWSER = NO
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
# classes and enums directly into the documentation.
......
File moved
File moved
File moved
CC = gcc
CFLAGS = -Wall -Wextra -g # L'option de debug -g à enlever
CPPFLAGS = -I include
# L'option de debug -g à enlever
CFLAGS = -Wall -Wextra -g
LDFLAGS =
LDLIBS = -lncurses
ALL_SOURCES = $(wildcard *.c)
TEST_SOURCES = $(filter-out main.c, $(ALL_SOURCES))
SOURCES = $(filter-out test.c, $(ALL_SOURCES))
HEADERS = $(wildcard *.h)
ALL_OBJECTS = $(ALL_SOURCES:.c=.o)
TEST_OBJECTS = $(TEST_SOURCES:.c=.o)
OBJECTS = $(SOURCES:.c=.o)
LEVELS = $(wildcard level*.txt)
DEPFLAGS = -MT $@ -MMD -MP -MF $(DPATH)$*.Td
POSTCOMPILE = mv -f $(DPATH)$*.Td $(DPATH)$*.d && touch $@
SPATH = src/
HPATH = include/
OPATH = obj/
DPATH = dep/
LEVELPATH = levels/
ALL_SOURCES = $(wildcard $(SPATH)*.c)
TEST_SOURCES = $(filter-out $(SPATH)main.c, $(ALL_SOURCES))
SOURCES = $(filter-out $(SPATH)test.c, $(ALL_SOURCES))
HEADERS = $(wildcard $(HPATH)*.h)
ALL_OBJECTS = $(addprefix $(OPATH),$(patsubst %.c,%.o,$(notdir $(ALL_SOURCES))))
TEST_OBJECTS = $(addprefix $(OPATH),$(patsubst %.c,%.o,$(notdir $(TEST_SOURCES))))
OBJECTS = $(addprefix $(OPATH),$(patsubst %.c,%.o,$(notdir $(SOURCES))))
ALL_DEPENDS = $(addprefix $(DPATH),$(patsubst %.c,%.d,$(notdir $(ALL_SOURCES))))
LEVELS = $(wildcard $(LEVELPATH)level*.txt)
DOCGEN = doxygen
DOXYFILE = doc/Doxyfile
ARCHIVE_NAME = ERKEN_Efe.tar.gz
ARCHIVE_SOURCES = $(SOURCES) $(HEADERS) makefile $(LEVELS) README.md Doxyfile
ARCHIVE_SOURCES = $(SOURCES) $(HEADERS) makefile $(LEVELS) README.md $(DOXYFILE)
ARCHIVER = tar
ARCHIVE_FLAGS = -cvzf
TEST_EXEC = sokoban_test
......@@ -29,16 +41,29 @@ $(EXEC) : $(OBJECTS)
$(TEST_EXEC) : $(TEST_OBJECTS)
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
%.o : %.c %.h
$(CC) $(CFLAGS) -c $<
$(OPATH)%.o : $(SPATH)%.c $(DPATH)%.d | $(OPATH) $(DPATH)
$(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
@$(POSTCOMPILE)
$(OPATH) :
mkdir -p $@
$(DPATH) :
mkdir -p $@
$(ALL_DEPENDS) :
# include $(wildcard $(ALL_DEPENDS))
-include $(ALL_DEPENDS)
clean :
rm -f $(EXEC) $(TEST_EXEC) $(ALL_OBJECTS)
rm -f $(EXEC) $(TEST_EXEC) $(ALL_OBJECTS) $(ALL_DEPENDS)
doc :
doxygen Doxyfile
$(DOCGEN) $(DOXYFILE)
archive : $(ARCHIVE_NAME)
$(ARCHIVE_NAME) : $(ARCHIVE_SOURCES)
$(ARCHIVER) $(ARCHIVE_FLAGS) $@ $^
File moved
File moved
File moved
......@@ -26,7 +26,7 @@ int main01()
int main02() {
// Test de la fonction init_level() dans grid.c
grid* level = init_level("level1.txt");
grid* level = init_level("levels/level1.txt");
printf("Number of lines is: %d\n", level->row_number);
printf("Number of columns is: %d\n", level->column_number);
......@@ -40,7 +40,7 @@ int main02() {
int main03() {
// Test de la fonction display() dans grid.c
grid* level = init_level("level1.txt");
grid* level = init_level("levels/level1.txt");
display(level);
free_level(level);
return 0;
......@@ -48,7 +48,7 @@ int main03() {
int main() {
// Test de la fonction move_player() dans player.c
grid* level = init_level("level1.txt");
grid* level = init_level("levels/level1.txt");
char quitCar = '\0';
while (quitCar != 'q') {
printf("Appuyez sur \"q\" pour quitter\n");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment