explicaiton des makefiles presque fini
This commit is contained in:
@@ -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
BIN
test/builds/to_uppercase.o
Normal file
Binary file not shown.
@@ -5,5 +5,6 @@
|
||||
|
||||
void ft_putchar(char c);
|
||||
int transform(int a);
|
||||
int to_uppercase(int a);
|
||||
|
||||
# endif
|
||||
|
||||
@@ -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
7
test/srcs/to_uppercase.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "test.h"
|
||||
|
||||
int to_uppercase(int a)
|
||||
{
|
||||
a -= 32;
|
||||
return(a);
|
||||
}
|
||||
Reference in New Issue
Block a user