Skip to content

Commit 97db677

Browse files
committed
docker library missing fix #4
1 parent f6f2256 commit 97db677

File tree

9 files changed

+155
-28
lines changed

9 files changed

+155
-28
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ RUN apt-get update \
2828
'libxext-dev' \
2929
'libx11-dev' \
3030
'libbsd-dev' \
31+
'libreadline-dev' \
3132
'lldb' \
3233
xorg \
3334
&& apt-get clean autoclean \

.vscode/configurationCache.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"buildTargets":[],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}}
1+
{"buildTargets":["all","clean","fclean","lib/libft/libft.a","minishell","obj/src/main.o","re"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}}

.vscode/dryrun.log

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
make --dry-run --always-make --keep-going --print-directory
22
make: Entering directory '/workspaces/42minishell'
3+
make -C lib/libft/
34
make: Leaving directory '/workspaces/42minishell'
45

5-
make: *** No targets. Stop.
6-

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"libft.h": "c",
66
"limits": "c",
77
"get_next_line.h": "c",
8-
"minishell.h": "c"
8+
"minishell.h": "c",
9+
"readline.h": "c"
910
},
1011
"C_Cpp.formatting": "Disabled",
1112
"editor.detectIndentation": true,

.vscode/targets.log

Lines changed: 142 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
make all --print-data-base --no-builtin-variables --no-builtin-rules --question
2-
make: *** No rule to make target 'all'. Stop.
3-
42
# GNU Make 4.3
53
# Built for x86_64-pc-linux-gnu
64
# Copyright (C) 1988-2020 Free Software Foundation, Inc.
75
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
86
# This is free software: you are free to change and redistribute it.
97
# There is NO WARRANTY, to the extent permitted by law.
8+
109

11-
# Make data base, printed on Tue Apr 19 14:31:14 2022
10+
# Make data base, printed on Wed Apr 20 13:18:24 2022
1211

1312
# Variables
1413

1514
# environment
16-
REMOTE_CONTAINERS_SOCKETS = ["/tmp/vscode-ssh-auth-40d47d8abfb0db64fcedc8d6964867988a81cf27.sock"]
15+
REMOTE_CONTAINERS_SOCKETS = ["/tmp/vscode-ssh-auth-75f27e5190fe6156b75b37d4eef3103b94f90cd7.sock"]
16+
# makefile (from 'Makefile', line 18)
17+
LIBDIR = lib/libft/
1718
# environment
1819
LC_ALL = C
20+
# makefile (from 'Makefile', line 21)
21+
SRC = src/main.c src/tools/prompt.c
1922
# environment
2023
VSCODE_CWD = /vscode/vscode-server/bin/linux-x64/dfd34e8260c270da74b5c2d86d61aee4b6d56977
24+
# makefile (from 'Makefile', line 17)
25+
MINISHELL_HEADER = include/minishell.h
2126
# default
2227
MAKE_COMMAND := make
2328
# automatic
2429
@D = $(patsubst %/,%,$(dir $@))
30+
# makefile (from 'Makefile', line 27)
31+
OBJ_DIR = obj/
2532
# environment
2633
VSCODE_HANDLES_UNCAUGHT_ERRORS = true
2734
# default
@@ -31,13 +38,17 @@ PWD = /workspaces/42minishell
3138
# automatic
3239
%D = $(patsubst %/,%,$(dir $%))
3340
# environment
34-
HOSTNAME = ac11909923fe
41+
HOSTNAME = 4109d4e56478
3542
# automatic
3643
^D = $(patsubst %/,%,$(dir $^))
3744
# environment
3845
VSCODE_LOG_STACK = false
3946
# automatic
4047
%F = $(notdir $%)
48+
# makefile (from 'Makefile', line 19)
49+
LIBFT = lib/libft/libft.a
50+
# makefile (from 'Makefile', line 25)
51+
CC_FLAG = -Wall -Wextra -Werror
4152
# environment
4253
LANG = C
4354
# default
@@ -46,6 +57,8 @@ LANG = C
4657
.INCLUDE_DIRS = /usr/local/include /usr/include /usr/include
4758
# makefile
4859
MAKEFLAGS = pqrR
60+
# makefile (from 'Makefile', line 29)
61+
OBJECTS_PREFIXED = $(addprefix $(OBJ_DIR), $(OBJS))
4962
# makefile
5063
CURDIR := /workspaces/42minishell
5164
# environment
@@ -57,7 +70,7 @@ APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = true
5770
# environment
5871
MFLAGS = -pqrR
5972
# environment
60-
SSH_AUTH_SOCK = /tmp/vscode-ssh-auth-40d47d8abfb0db64fcedc8d6964867988a81cf27.sock
73+
SSH_AUTH_SOCK = /tmp/vscode-ssh-auth-75f27e5190fe6156b75b37d4eef3103b94f90cd7.sock
6174
# default
6275
.SHELLFLAGS := -c
6376
# automatic
@@ -78,6 +91,8 @@ VSCODE_VERBOSE_LOGGING = true
7891
VSCODE_NLS_CONFIG = {"locale":"en","availableLanguages":{}}
7992
# default
8093
MAKE_HOST := x86_64-pc-linux-gnu
94+
# makefile (from 'Makefile', line 28)
95+
OBJS = $(SRC:.c=.o)
8196
# makefile
8297
SHELL = /bin/sh
8398
# default
@@ -97,19 +112,21 @@ MAKEFILES :=
97112
# environment
98113
VSCODE_LOG_NATIVE = false
99114
# environment
100-
REMOTE_CONTAINERS_IPC = /tmp/vscode-remote-containers-ipc-40d47d8abfb0db64fcedc8d6964867988a81cf27.sock
115+
REMOTE_CONTAINERS_IPC = /tmp/vscode-remote-containers-ipc-75f27e5190fe6156b75b37d4eef3103b94f90cd7.sock
101116
# environment
102117
REMOTE_CONTAINERS = true
103118
# automatic
104119
?F = $(notdir $?)
120+
# makefile (from 'Makefile', line 15)
121+
NAME = minishell
105122
# automatic
106123
+F = $(notdir $+)
107124
# 'override' directive
108125
GNUMAKEFLAGS :=
109126
# environment
110127
BROWSER = /vscode/vscode-server/bin/linux-x64/dfd34e8260c270da74b5c2d86d61aee4b6d56977/bin/helpers/browser.sh
111128
# makefile
112-
.DEFAULT_GOAL :=
129+
.DEFAULT_GOAL := lib/libft/libft.a
113130
# environment
114131
DISPLAY = 192.168.4.222:0.0
115132
# default
@@ -121,7 +138,7 @@ VSCODE_AGENT_FOLDER = /root/.vscode-server
121138
# environment
122139
_ = /bin/cat
123140
# environment
124-
VSCODE_IPC_HOOK_CLI = /tmp/vscode-ipc-8ef2ca9a-e432-4fa1-bc10-1ccd25fd2586.sock
141+
VSCODE_IPC_HOOK_CLI = /tmp/vscode-ipc-b9c71211-86f7-4e94-ba54-b22057e6d7c9.sock
125142
# environment
126143
VSCODE_AMD_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess
127144
# environment
@@ -134,59 +151,162 @@ HOME = /root
134151
SUFFIXES :=
135152
# default
136153
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell nocomment grouped-target extra-prereqs archives jobserver output-sync check-symlink load
154+
# makefile (from 'Makefile', line 24)
155+
CC = gcc -g
137156
# variable set hash-table stats:
138-
# Load=61/1024=6%, Rehash=0, Collisions=2/90=2%
157+
# Load=71/1024=7%, Rehash=0, Collisions=4/117=3%
139158

140159
# Pattern-specific Variable Values
141160

142161
# No pattern-specific variable values.
143162

144163
# Directories
145164

146-
# . (device 117, inode 121325117): 11 files, no impossibilities.
165+
# include (device 49, inode 2814749767538948): 3 files, no impossibilities so far.
166+
# src (device 49, inode 3940649674449791): 3 files, no impossibilities so far.
167+
# . (device 49, inode 9570149208337957): 13 files, no impossibilities.
147168

148-
# 11 files, no impossibilities in 1 directories.
169+
# 19 files, no impossibilities in 3 directories.
149170

150171
# Implicit Rules
151172

152-
# No implicit rules.
173+
obj/%.o: %.c include/minishell.h
174+
# recipe to execute (from 'Makefile', line 32):
175+
@mkdir -p $(OBJ_DIR)/src
176+
@mkdir -p $(OBJ_DIR)/src/tools
177+
@echo "Compiling $@"
178+
@$(CC) -c $< -o $@
153179

180+
# 1 implicit rules, 0 (0.0%) terminal.
154181
# Files
155182

183+
lib/libft/libft.a:
184+
# Implicit rule search has not been done.
185+
# Modification time never checked.
186+
# File has not been updated.
187+
# recipe to execute (from 'Makefile', line 38):
188+
make -C $(LIBDIR)
189+
190+
191+
minishell: obj/src/main.o obj/src/tools/prompt.o lib/libft/libft.a
192+
# Implicit rule search has not been done.
193+
# File does not exist.
194+
# File has been updated.
195+
# Needs to be updated (-q is set).
196+
# variable set hash-table stats:
197+
# Load=0/32=0%, Rehash=0, Collisions=0/6=0%
198+
# recipe to execute (from 'Makefile', line 41):
199+
@$(CC) $(CC_FLAG) $(OBJECTS_PREFIXED) $(LIBFT) -o $(NAME)
200+
@echo "minishell Done !"
201+
156202
# Not a target:
157203
Makefile:
158204
# Implicit rule search has been done.
159-
# Last modified 2022-04-19 14:26:46.146540094
205+
# Last modified 2022-04-20 12:36:21.4135147
160206
# File has been updated.
161207
# Successfully updated.
162208

209+
clean:
210+
# Implicit rule search has not been done.
211+
# Modification time never checked.
212+
# File has not been updated.
213+
# recipe to execute (from 'Makefile', line 48):
214+
@echo "Cleaning"
215+
@rm -rf $(OBJ_DIR)
216+
@rm -rf $(NAME)
217+
218+
obj/src/main.o: src/main.c include/minishell.h
219+
# Implicit rule search has been done.
220+
# Implicit/static pattern stem: 'src/main'
221+
# Last modified 2022-04-20 12:47:47.3938387
222+
# File has been updated.
223+
# Needs to be updated (-q is set).
224+
# automatic
225+
# @ := obj/src/main.o
226+
# automatic
227+
# * := src/main
228+
# automatic
229+
# < := src/main.c
230+
# automatic
231+
# + := src/main.c include/minishell.h
232+
# automatic
233+
# % :=
234+
# automatic
235+
# ^ := src/main.c include/minishell.h
236+
# automatic
237+
# ? := src/main.c
238+
# automatic
239+
# | :=
240+
# variable set hash-table stats:
241+
# Load=8/32=25%, Rehash=0, Collisions=2/17=12%
242+
# recipe to execute (from 'Makefile', line 32):
243+
@mkdir -p $(OBJ_DIR)/src
244+
@mkdir -p $(OBJ_DIR)/src/tools
245+
@echo "Compiling $@"
246+
@$(CC) -c $< -o $@
247+
163248
# Not a target:
164-
.DEFAULT:
249+
src/main.c:
250+
# Implicit rule search has been done.
251+
# Last modified 2022-04-20 13:14:51.1833065
252+
# File has been updated.
253+
# Successfully updated.
254+
255+
re: fclean all
165256
# Implicit rule search has not been done.
166257
# Modification time never checked.
167258
# File has not been updated.
168259

169260
# Not a target:
170-
all:
261+
.DEFAULT:
262+
# Implicit rule search has not been done.
263+
# Modification time never checked.
264+
# File has not been updated.
265+
266+
all: minishell
171267
# Command line target.
172268
# Implicit rule search has been done.
173269
# File does not exist.
270+
# File has been updated.
271+
# Needs to be updated (-q is set).
272+
# variable set hash-table stats:
273+
# Load=0/32=0%, Rehash=0, Collisions=0/6=0%
274+
275+
fclean:
276+
# Implicit rule search has not been done.
277+
# Modification time never checked.
278+
# File has not been updated.
279+
# recipe to execute (from 'Makefile', line 53):
280+
rm -f $(NAME)
281+
282+
# Not a target:
283+
include/minishell.h:
284+
# Implicit rule search has been done.
285+
# Last modified 2022-04-20 12:36:21.419523
286+
# File has been updated.
287+
# Successfully updated.
288+
289+
# Not a target:
290+
obj/src/tools/prompt.o:
291+
# Implicit rule search has not been done.
292+
# Modification time never checked.
174293
# File has not been updated.
175294

176295
# files hash-table stats:
177-
# Load=4/1024=0%, Rehash=0, Collisions=0/14=0%
296+
# Load=13/1024=1%, Rehash=0, Collisions=0/35=0%
178297
# VPATH Search Paths
179298

180299
# No 'vpath' search paths.
181300

182301
# No general ('VPATH' variable) search path.
183302

184-
# strcache buffers: 1 (0) / strings = 16 / storage = 133 B / avg = 8 B
185-
# current buf: size = 8162 B / used = 133 B / count = 16 / avg = 8 B
303+
# strcache buffers: 1 (0) / strings = 32 / storage = 305 B / avg = 9 B
304+
# current buf: size = 8162 B / used = 305 B / count = 32 / avg = 9 B
186305

187-
# strcache performance: lookups = 20 / hit rate = 20%
306+
# strcache performance: lookups = 56 / hit rate = 42%
188307
# hash-table stats:
189-
# Load=16/8192=0%, Rehash=0, Collisions=0/20=0%
190-
# Finished Make data base on Tue Apr 19 14:31:14 2022
308+
309+
# Load=32/8192=0%, Rehash=0, Collisions=1/56=2%
310+
# Finished Make data base on Wed Apr 20 13:18:24 2022
191311

192312

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
[good to start 01](https://www.geeksforgeeks.org/making-linux-shell-c/)
77

88
[good to start 02](https://brennan.io/2015/01/16/write-a-shell-in-c/)
9+
10+
### readline libery.

en.subject.pdf

1.25 MB
Binary file not shown.

minishell

-48.9 KB
Binary file not shown.

src/main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
/* By: oal-tena <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/04/19 19:09:54 by oal-tena #+# #+# */
9-
/* Updated: 2022/04/20 09:51:25 by oal-tena ### ########.fr */
9+
/* Updated: 2022/04/20 13:14:51 by oal-tena ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "../include/minishell.h"
1414

15+
16+
#include <readline/readline.h>
17+
#include <readline/history.h>
18+
1519
int main(int argc, char **argv, char **env)
1620
{
1721
(void)argc;
1822
(void)argv;
1923
(void)env;
2024
prompt_commend();
21-
ft_putstr_fd(GREEN"hi there\n", 1);
25+
lsh_loop();
2226
return (0);
2327
}

0 commit comments

Comments
 (0)