# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr
BINARY_NAME:=exo1
SRC_PATH:=src
-LIBRARY_NAME:=libexo1
+LIBRARY_NAME:=lib$(BINARY_NAME)
LIBRARY_PATH:=lib
+LDLIBS:=-l$(BINARY_NAME)
BUILD_TYPE:=debug
#BUILD_TYPE=release
LDFLAGS := $(LDFLAGS) $(LDFLAGS_LTO) $(LDFLAGS_GOLD) $(STRIP_FLAG)
LIBLDFLAGS := -shared $(LDFLAGS)
STATICLIBLDFLAGS := -static $(LDFLAGS)
-LDLIBS := $(LDLIBS) -L$(LIBRARY_PATH) -l$(BINARY_NAME)
+LDLIBS := $(LDLIBS) -L$(LIBRARY_PATH)
all: $(BINARY_NAME)$(BINARY_SUFFIX) $(BINARY_NAME).dynamic$(BINARY_SUFFIX) $(BINARY_NAME).static$(BINARY_SUFFIX)
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr
BINARY_NAME:=exo2
SRC_PATH:=src
-LIBRARY_NAME:=libexo2
+LIBRARY_NAME:=lib$(BINARY_NAME)
LIBRARY_PATH:=lib
-LDLIBS:=-lncurses -ltinfo
+LDLIBS:=-l$(BINARY_NAME) -lncurses -ltinfo
BUILD_TYPE:=debug
#BUILD_TYPE:=release
LDFLAGS := $(LDFLAGS) $(LDFLAGS_LTO) $(LDFLAGS_GOLD) $(STRIP_FLAG)
LIBLDFLAGS := -shared $(LDFLAGS)
STATICLIBLDFLAGS := -static $(LDFLAGS)
-LDLIBS := $(LDLIBS) -L$(LIBRARY_PATH) -l$(BINARY_NAME)
+LDLIBS := $(LDLIBS) -L$(LIBRARY_PATH)
all: $(BINARY_NAME)$(BINARY_SUFFIX) $(BINARY_NAME).dynamic$(BINARY_SUFFIX) $(BINARY_NAME).static$(BINARY_SUFFIX)
if (y == 1) {
return 0;
- } else if (y == 2) {
- return 3;
- } else {
+ } else if (y > 1 && y <= 3) {
+ return (remap_y(y - 1) + 3);
+ } else {
+ /* FIXME: return an error value like -1
+ * but for now there a bug somewhere */
return 6;
}
}
if (x == 1) {
return 1;
- } else if (x == 2) {
- return 6;
+ } else if (x > 1 && x <= 3) {
+ return (remap_x(x - 1) + 5);
} else {
+ /* FIXME: return an error value like -1
+ * but for now there a bug somewhere */
return 11;
}
}
char* exit_msg = malloc(str_max_length * sizeof(char));
initscr();
+ if (has_colors() == false) {
+ endwin();
+ printf("Votre terminal ne supporte pas les couleurs.\n");
+ exit(EXIT_FAILURE);
+ }
+ start_color();
getmaxyx(stdscr, row, col);
noecho();
curs_set(0);