ajout explications
This commit is contained in:
BIN
test/.Makefile.swp
Normal file
BIN
test/.Makefile.swp
Normal file
Binary file not shown.
9
test/Makefile
Normal file
9
test/Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
SRC = main.c putchar.c transform.c
|
||||
DEP = test.h
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
test: $(OBJ)
|
||||
gcc -I. -o test $(OBJ)
|
||||
%.o: %.c $(DEP)
|
||||
gcc -I. -c $<
|
||||
|
||||
BIN
test/libtest.a
Normal file
BIN
test/libtest.a
Normal file
Binary file not shown.
9
test/main.c
Normal file
9
test/main.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "test.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
int a = 't';
|
||||
a = transform(a);
|
||||
ft_putchar(a);
|
||||
return (0);
|
||||
}
|
||||
BIN
test/main.o
Normal file
BIN
test/main.o
Normal file
Binary file not shown.
6
test/putchar.c
Normal file
6
test/putchar.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "test.h"
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
BIN
test/putchar.o
Normal file
BIN
test/putchar.o
Normal file
Binary file not shown.
9
test/test.h
Normal file
9
test/test.h
Normal file
@@ -0,0 +1,9 @@
|
||||
# ifndef TEST_H
|
||||
# define TEST_H
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putchar(char c);
|
||||
int transform(int a);
|
||||
|
||||
# endif
|
||||
6
test/transform.c
Normal file
6
test/transform.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "test.h"
|
||||
|
||||
int transform(int a)
|
||||
{
|
||||
return(--a);
|
||||
}
|
||||
BIN
test/transform.o
Normal file
BIN
test/transform.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user