Makefile progress, just noticed -R is broken
This commit is contained in:
parent
000074da91
commit
3688fb9f1b
7 changed files with 16 additions and 16 deletions
|
|
@ -21,10 +21,7 @@ RM = /bin/rm -rf
|
||||||
|
|
||||||
.PHONY: all clean fclean re tags test libft
|
.PHONY: all clean fclean re tags test libft
|
||||||
|
|
||||||
all: libft $(NAME) $(TAGFILE)
|
all: $(NAME) $(TAGFILE)
|
||||||
|
|
||||||
test:
|
|
||||||
gcc -Iincludes main.c libftprintf.a
|
|
||||||
|
|
||||||
$(TAGFILE): $(D_SRC)/*.c
|
$(TAGFILE): $(D_SRC)/*.c
|
||||||
@ctags -f $(TAGFILE) $(addprefix $(D_SRC)/, $(F_SRC))
|
@ctags -f $(TAGFILE) $(addprefix $(D_SRC)/, $(F_SRC))
|
||||||
|
|
@ -38,13 +35,15 @@ $(D_OBJ)/%.o: $(D_SRC)/%.c $(D_INC)
|
||||||
libft:
|
libft:
|
||||||
@$(MAKE) -C libft/ 2>/dev/null
|
@$(MAKE) -C libft/ 2>/dev/null
|
||||||
|
|
||||||
$(NAME): $(DF_OBJ) libft/libft.a
|
$(NAME): libft $(DF_OBJ) libft/libft.a
|
||||||
$(CC) $(O_INC) -Llibft -lft $(W_FLAGS) $(DF_OBJ) -o $@ $(D_FLAGS)
|
$(CC) $(O_INC) -Llibft -lft $(W_FLAGS) $(DF_OBJ) -o $@ $(D_FLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(D_OBJ)
|
$(RM) $(D_OBJ)
|
||||||
|
@$(MAKE) -C libft clean 2>/dev/null
|
||||||
|
|
||||||
fclean: clean
|
fclean: clean
|
||||||
$(RM) $(NAME)
|
$(RM) $(NAME)
|
||||||
|
@$(MAKE) -C libft fclean 2>/dev/null
|
||||||
|
|
||||||
re: fclean all
|
re: fclean all
|
||||||
|
|
|
||||||
1
ls/auteur
Normal file
1
ls/auteur
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
jhalford
|
||||||
BIN
ls/ft_ls.fr.pdf
BIN
ls/ft_ls.fr.pdf
Binary file not shown.
2
ls/libft
2
ls/libft
|
|
@ -1 +1 @@
|
||||||
Subproject commit 27c15060b59c76458da441881cdcb05055db1711
|
Subproject commit 2b3b4ad458b00949259de266fa418e55dcd8c006
|
||||||
|
|
@ -18,9 +18,13 @@ void ft_ls_dirs(t_list *dir, char *opts)
|
||||||
ft_ent_print(ent, opts, dirdata, dir);
|
ft_ent_print(ent, opts, dirdata, dir);
|
||||||
if (ft_strchr(opts, 'R'))
|
if (ft_strchr(opts, 'R'))
|
||||||
{
|
{
|
||||||
|
ft_debug();
|
||||||
dir_r = ft_ent_get_dirs(ent);
|
dir_r = ft_ent_get_dirs(ent);
|
||||||
|
ft_debug();
|
||||||
ft_lst_merge(&dir_r, dir);
|
ft_lst_merge(&dir_r, dir);
|
||||||
|
ft_debug();
|
||||||
dir = dir_r;
|
dir = dir_r;
|
||||||
|
ft_debug();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ int ft_ls_long_lnk(t_lsdata *data)
|
||||||
ft_bzero(&statbuf, sizeof(statbuf));
|
ft_bzero(&statbuf, sizeof(statbuf));
|
||||||
if (S_ISLNK(data->stat.st_mode))
|
if (S_ISLNK(data->stat.st_mode))
|
||||||
{
|
{
|
||||||
printf(" -> %lld\n", statbuf.st_size);
|
ft_printf(" -> %lld\n", statbuf.st_size);
|
||||||
printf("path: %s\n", data->path);
|
ft_printf("path: %s\n", data->path);
|
||||||
if ((ret = stat(data->path, &statbuf)) == -1)
|
if ((ret = stat(data->path, &statbuf)) == -1)
|
||||||
printf("stat=%i, errno=%i\n", ret, errno);
|
ft_printf("stat=%i, errno=%i\n", ret, errno);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("\n");
|
ft_putendl("");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,12 +53,11 @@ int ft_ls_long_xattr(char *path)
|
||||||
x = ' ';
|
x = ' ';
|
||||||
if ((n = ft_xattr_count(path)) == -1)
|
if ((n = ft_xattr_count(path)) == -1)
|
||||||
{
|
{
|
||||||
printf("\ncouldnt get xattr: %i\n", n);
|
ft_printf("\ncouldnt get xattr: %i\n", n);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
x = '@';
|
x = '@';
|
||||||
/* ft_printf("%c", x); */
|
|
||||||
ft_putchar(x);
|
ft_putchar(x);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
@ -74,12 +73,11 @@ void ft_ls_long_total(t_list *ent)
|
||||||
{
|
{
|
||||||
data = ent->content;
|
data = ent->content;
|
||||||
stat = data->stat;
|
stat = data->stat;
|
||||||
/* dirent = data->dirent; */
|
|
||||||
ent = ent->next;
|
ent = ent->next;
|
||||||
|
|
||||||
total += stat.st_blocks;
|
total += stat.st_blocks;
|
||||||
}
|
}
|
||||||
printf("total %i\n", total);
|
ft_printf("total %i\n", total);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ft_ls_long_pads(t_list *ent, t_pads *pads)
|
int ft_ls_long_pads(t_list *ent, t_pads *pads)
|
||||||
|
|
@ -93,7 +91,6 @@ int ft_ls_long_pads(t_list *ent, t_pads *pads)
|
||||||
{
|
{
|
||||||
data = ent->content;
|
data = ent->content;
|
||||||
stat = data->stat;
|
stat = data->stat;
|
||||||
/* dirent = data->dirent; */
|
|
||||||
ent = ent->next;
|
ent = ent->next;
|
||||||
|
|
||||||
if ((pwd = getpwuid(stat.st_uid)) == NULL)
|
if ((pwd = getpwuid(stat.st_uid)) == NULL)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include "ftls.h"
|
#include "ftls.h"
|
||||||
#include "ftls.h"
|
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int main(int ac, char **av)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue