Overview
Thedevcpc clean command removes all generated files from your project, including intermediate compilation files and final output files.
Syntax
What Gets Removed
obj/ Directory (Intermediate Files)
Removes all intermediate compilation files:*.bin- Compiled binaries*.lst- Assembly listings*.map- Memory maps*.ihx- Intel HEX files (C)*.lk- Linker files*.noi- Debug info*.rel- Relocatable files*.sym- Symbol files*.scn- Screen files*.scn.info- Palette info
dist/ Directory (Output Files)
Removes all final output files:*.dsk- Disk images*.cdt- Tape images*.cpr- Cartridge ROMs
ASM Backup Files
Removes backup files created during compilation:*.backup- ABASM backups*.backup_build- Build backups*.bak- General backups*.BAK- General backups
Output Example
When to Use Clean
Before Fresh Build
Clean before building to ensure all files are regenerated:After Configuration Changes
Clean when changing major configuration:Disk Space Management
Clean to free up disk space:Troubleshooting Build Issues
Clean when experiencing build problems:What Stays
The following files/directories are NOT removed:devcpc.conf- Project configurationREADME.md- Documentation.gitignore- Git configurationASM/- Source codebas/- BASIC filessrc/- Source codeassets/- PNG sprites and screensraw/- Raw binary filesc/- C source codemusic/- Music files
sprites.asm file in ASM/ or src/ is preserved (it will be regenerated on next build if needed).
Clean vs Build
| Command | Purpose | When to Use |
|---|---|---|
clean | Remove generated files | Before fresh build, troubleshooting |
build | Compile project | After code changes |
clean && build | Fresh compilation | After major config changes |
Clean in Workflows
Development Workflow
Clean Build Workflow
Release Workflow
Size Information
Typical disk space usage:| Project Type | obj/ Size | dist/ Size | Total |
|---|---|---|---|
| Small (BASIC only) | 10-50 KB | 100-200 KB | ~250 KB |
| Medium (8BP + graphics) | 100-500 KB | 200-400 KB | ~900 KB |
| Large (8BP + C + CDT + CPR) | 500 KB - 2 MB | 400 KB - 1 MB | ~3 MB |
Error Handling
Git Integration
The.gitignore file created by devcpc new already ignores:
obj/ and dist/ are never committed to Git, and devcpc clean removes exactly what Git ignores.
Automation
You can automate clean in scripts:Related Commands
devcpc build- Build after cleaningdevcpc validate- Validate before buildingdevcpc new- Create new clean project