Makefile progress, just noticed -R is broken

This commit is contained in:
Jack Halford 2016-11-06 23:40:29 +01:00
parent 000074da91
commit 3688fb9f1b
7 changed files with 16 additions and 16 deletions

View file

@ -21,10 +21,7 @@ RM = /bin/rm -rf
.PHONY: all clean fclean re tags test libft
all: libft $(NAME) $(TAGFILE)
test:
gcc -Iincludes main.c libftprintf.a
all: $(NAME) $(TAGFILE)
$(TAGFILE): $(D_SRC)/*.c
@ctags -f $(TAGFILE) $(addprefix $(D_SRC)/, $(F_SRC))
@ -38,13 +35,15 @@ $(D_OBJ)/%.o: $(D_SRC)/%.c $(D_INC)
libft:
@$(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)
clean:
$(RM) $(D_OBJ)
@$(MAKE) -C libft clean 2>/dev/null
fclean: clean
$(RM) $(NAME)
@$(MAKE) -C libft fclean 2>/dev/null
re: fclean all

1
ls/auteur Normal file
View file

@ -0,0 +1 @@
jhalford

Binary file not shown.

@ -1 +1 @@
Subproject commit 27c15060b59c76458da441881cdcb05055db1711
Subproject commit 2b3b4ad458b00949259de266fa418e55dcd8c006

View file

@ -18,9 +18,13 @@ void ft_ls_dirs(t_list *dir, char *opts)
ft_ent_print(ent, opts, dirdata, dir);
if (ft_strchr(opts, 'R'))
{
ft_debug();
dir_r = ft_ent_get_dirs(ent);
ft_debug();
ft_lst_merge(&dir_r, dir);
ft_debug();
dir = dir_r;
ft_debug();
}
}
}

View file

@ -35,13 +35,13 @@ int ft_ls_long_lnk(t_lsdata *data)
ft_bzero(&statbuf, sizeof(statbuf));
if (S_ISLNK(data->stat.st_mode))
{
printf(" -> %lld\n", statbuf.st_size);
printf("path: %s\n", data->path);
ft_printf(" -> %lld\n", statbuf.st_size);
ft_printf("path: %s\n", data->path);
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
printf("\n");
ft_putendl("");
return (0);
}
@ -53,12 +53,11 @@ int ft_ls_long_xattr(char *path)
x = ' ';
if ((n = ft_xattr_count(path)) == -1)
{
printf("\ncouldnt get xattr: %i\n", n);
ft_printf("\ncouldnt get xattr: %i\n", n);
return (1);
}
if (n > 0)
x = '@';
/* ft_printf("%c", x); */
ft_putchar(x);
return (0);
}
@ -74,12 +73,11 @@ void ft_ls_long_total(t_list *ent)
{
data = ent->content;
stat = data->stat;
/* dirent = data->dirent; */
ent = ent->next;
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)
@ -93,7 +91,6 @@ int ft_ls_long_pads(t_list *ent, t_pads *pads)
{
data = ent->content;
stat = data->stat;
/* dirent = data->dirent; */
ent = ent->next;
if ((pwd = getpwuid(stat.st_uid)) == NULL)

View file

@ -1,5 +1,4 @@
#include "ftls.h"
#include "ftls.h"
int main(int ac, char **av)
{