makefile class finish
This commit is contained in:
@@ -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
BIN
test/builds/putchar.o
Normal file
Binary file not shown.
Binary file not shown.
BIN
test/builds/transform.o
Normal file
BIN
test/builds/transform.o
Normal file
Binary file not shown.
BIN
test/libtest.a
BIN
test/libtest.a
Binary file not shown.
6
test/srcs/putchar.c
Normal file
6
test/srcs/putchar.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "test.h"
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
6
test/srcs/transform.c
Normal file
6
test/srcs/transform.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "test.h"
|
||||
|
||||
int transform(int a)
|
||||
{
|
||||
return (--a);
|
||||
}
|
||||
Reference in New Issue
Block a user