explicaiton des makefiles presque fini

This commit is contained in:
Hugo LAMY
2019-11-15 19:39:02 +01:00
parent 28e08d8238
commit 848931d537
9 changed files with 289 additions and 50 deletions

View File

@@ -13,7 +13,7 @@ LDIR = ./
_LIBS = libtest.a
LIBS = $(_LIBS:lib%.a=%)
# FUNCTIONS et OBJETS #
SRCS = main.c #putchar.c transform.c
SRCS = main.c to_uppercase.c #putchar.c transform.c
ODIR = ./builds
OBJS = $(SRCS:%.c=$(ODIR)/%.o)
# OPTIONS de GCC #
@@ -25,7 +25,7 @@ LFLAGS = -L$(LDIR) -l$(LIBS)
#---------#
all: $(ODIR) $(NAME)
$(NAME): $(OBJS) $(DEPS)
$(CC) $(CFLAGS) -o test $(OBJS) $(LFLAGS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS)
$(ODIR):
mkdir -p $@
$(ODIR)/%.o: %.c

Binary file not shown.

BIN
test/builds/to_uppercase.o Normal file

Binary file not shown.

View File

@@ -5,5 +5,6 @@
void ft_putchar(char c);
int transform(int a);
int to_uppercase(int a);
# endif

View File

@@ -3,7 +3,8 @@
int main()
{
int a = 't';
a = to_uppercase(a);
a = transform(a);
ft_putchar(a);
return (0);
return(0);
}

7
test/srcs/to_uppercase.c Normal file
View File

@@ -0,0 +1,7 @@
#include "test.h"
int to_uppercase(int a)
{
a -= 32;
return(a);
}

BIN
test/test

Binary file not shown.