Signed-off-by: Mathéo Hersan <matheohersan@MacBook-Pro-de-Matheo.local>pull/1/head
parent
275a0c651a
commit
ece23d11f2
@ -1,43 +1,21 @@
|
||||
CC = gcc
|
||||
SRC_DIR = src
|
||||
OBJ_DIR = obj
|
||||
SOURCES = $(wildcard $(SRC_DIR)/*.c)
|
||||
OBJECTS = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SOURCES))
|
||||
EXECUTABLE = APP
|
||||
GCCFLAGS = -Wall -Wextra -I src -Wno-unused-parameter -Wno-unused-but-set-variable
|
||||
BUILD_DIR = build
|
||||
LDFLAGS =
|
||||
CFLAGS_RELEASE = -O3
|
||||
CFLAGS_DEBUG = -g -O0
|
||||
SOURCES = $(shell find src -name '*.c')
|
||||
TARGETS = $(patsubst %.c, %.o, $(SOURCES))
|
||||
TARGETS := $(addprefix $(BUILD_DIR)/, $(TARGETS))
|
||||
APP_NAME = app
|
||||
|
||||
# Generate dependency files
|
||||
DEPS = $(OBJECTS:.o=.d)
|
||||
-include $(DEPS)
|
||||
all: $(APP_NAME)
|
||||
|
||||
# Commands
|
||||
all: build
|
||||
$(APP_NAME): $(TARGETS)
|
||||
@gcc $(GCCFLAGS) -o $(APP_NAME) $(TARGETS)
|
||||
@echo -e $(GREEN)build done.$(RESET)
|
||||
|
||||
build: $(BUILD_DIR)/$(EXECUTABLE)
|
||||
$(TARGETS): $(SOURCES)
|
||||
@mkdir -p $(@D)
|
||||
@gcc $(GCCFLAGS) -c $(patsubst %.o, %.c, $(@:$(BUILD_DIR)/%=%)) -o $@
|
||||
|
||||
$(BUILD_DIR)/$(EXECUTABLE): $(OBJECTS)
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
$(CC) $(LDFLAGS) -o $@ $^
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
|
||||
@mkdir -p $(OBJ_DIR)
|
||||
$(CC) -c $(CFLAGS_RELEASE) -MMD -MP -o $@ $<
|
||||
|
||||
debug:
|
||||
$(MAKE) CFLAGS_RELEASE="$(CFLAGS_DEBUG)" build
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ_DIR) $(BUILD_DIR)
|
||||
|
||||
run: build
|
||||
$<
|
||||
|
||||
doc_doxygen:
|
||||
@echo "Doxygen build started"
|
||||
@$(MAKE) -C docs
|
||||
|
||||
.PHONY: all build debug clean run doc_doxygen
|
||||
|
||||
@rm -r $(BUILD_DIR) $(APP_NAME)
|
||||
@echo -e $(GREEN)clean done.$(RESET)
|
@ -1,2 +0,0 @@
|
||||
#include "interface_client.h"
|
||||
|
@ -0,0 +1,3 @@
|
||||
#include<stdio.h>
|
||||
|
||||
void affiche_client();
|
@ -0,0 +1 @@
|
||||
#include "interface_resp.h"
|
@ -1 +0,0 @@
|
||||
#include "interface_resp.h"
|
@ -1,8 +1,9 @@
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include "app/interface/client/interface_client.h"
|
||||
#include "app/interface/resp/interface_resp.h"
|
||||
#include "app/interface/interface_client.h"
|
||||
#include "app/interface/interface_resp.h"
|
||||
|
||||
int main(){
|
||||
printf("Hello World\n");
|
||||
|
||||
affiche_client();
|
||||
}
|
||||
|
Loading…
Reference in new issue