Skip to content

Commit a9f82e9

Browse files
committed
Use CMake instead of make
1 parent 047c50e commit a9f82e9

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
cshell
1+
cshell
2+
/cmake-build-wsl/
3+
/cmake-build-debug/
4+
/.idea/

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(CShell)
3+
4+
set(CMAKE_C_STANDARD 11)
5+
6+
set(SOURCES
7+
src/builtins.c
8+
src/main.c
9+
)
10+
11+
set(HEADERS
12+
src/builtins.h
13+
)
14+
15+
add_executable(cshell ${SOURCES} ${HEADERS})

Makefile

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@ A basic shell implementation made in C.
33
# Installation
44
Compatible on Linux distros which have GCC installed.
55

6-
The shell can be compiled using make `make cshell`
7-
8-
The command `./cshell` can be used to run it after compilation.
9-
10-
# Functionality
11-
The shell can execute external programs and supports program arguments.
12-
13-
Inbuilt Commands:
14-
- cd
15-
- exit
16-
- help
6+
The shell can be compiled using CMake:
7+
```
8+
$ mkdir build
9+
$ cd build
10+
$ cmake ..
11+
$ make
12+
```
13+
14+
To run the shell:
15+
```
16+
$ cd build
17+
$ ./cshell
18+
```
19+
20+
# Features
21+
- Execute external programs
22+
- Supports program arguments
23+
- Inbuilt commands(eg: cd, exit, help)
1724

1825
The man command can be used for information regarding other programs.
19-
2026

2127
# Lifetime of the Shell
2228
The shell in its lifetime has 3 basic states:

0 commit comments

Comments
 (0)