https://github.com/cheapnightbot/cheap-compiler
https://github.com/cheapnightbot/cheap-compiler
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cheapnightbot/cheap-compiler
- Owner: CheapNightbot
- License: gpl-3.0
- Created: 2024-09-24T23:57:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T23:57:30.000Z (almost 2 years ago)
- Last Synced: 2025-03-19T06:35:32.503Z (over 1 year ago)
- Language: C
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cheap-compiler
1. Convert `scanner.flex` into `scanner.c`:
```bash
flex -o scanner.c scanner.flex
```
2. Compile both `main.c` and `scanner.c`, but do not link:
```bash
gcc -c -o main.o main.c
gcc -c -o scanner.o scanner.c
```
3. Link `main.o` and `scanner.o` together to make an executable:
```bash
gcc -Xlinker -o scanner main.o scanner.o
# OR
gcc -Xlinker -o scanner.exe main.o scanner.o
```