makefile class finish

This commit is contained in:
hugodu69
2019-11-16 14:35:48 +01:00
parent 2a86ed7724
commit 6806ab114b
10 changed files with 382 additions and 369 deletions

View File

@@ -13,7 +13,7 @@ LDIR = ./
_LIBS = libtest.a
LIBS = $(_LIBS:lib%.a=%)
# FUNCTIONS et OBJETS #
SRCS = main.c to_uppercase.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 #
@@ -24,8 +24,10 @@ LFLAGS = -L$(LDIR) -l$(LIBS)
# RULES #
#---------#
all: $(ODIR) $(NAME)
#$(NAME): $(OBJS) $(DEPS)
# $(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS)
$(NAME): $(OBJS) $(DEPS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS)
ar rc $@ $(OBJS)
$(ODIR):
mkdir -p $@
$(ODIR)/%.o: %.c

Binary file not shown.

BIN
test/builds/putchar.o Normal file

Binary file not shown.

Binary file not shown.

BIN
test/builds/transform.o Normal file

Binary file not shown.

Binary file not shown.

6
test/srcs/putchar.c Normal file
View File

@@ -0,0 +1,6 @@
#include "test.h"
void ft_putchar(char c)
{
write(1, &c, 1);
}

6
test/srcs/transform.c Normal file
View File

@@ -0,0 +1,6 @@
#include "test.h"
int transform(int a)
{
return (--a);
}

BIN
test/test Normal file

Binary file not shown.