[{"data":1,"prerenderedAt":9},["ShallowReactive",2],{"post-\u002Fblog\u002Fmake":3},{"path":4,"title":5,"description":6,"date":7,"rawbody":8},"\u002Fblog\u002Fmake","Makefiles: Stop Typing for Nothing","Automate your commands, save your fingers.","2025-12-18","---\ntitle: 'Makefiles: Stop Typing for Nothing'\ndescription: 'Automate your commands, save your fingers.'\ndate: '2025-12-18'\n---\n\nTyping the same long-ass commands into your terminal every five minutes is a special kind of masochism. You aren't paid by the keystroke, so stop acting like it.\n\nMakefile has been around since 1976. It’s older than your favorite \"game-changing\" framework and it still does the job better than most of them.\n\n> \"If it’s stupid but it works, it ain't stupid. But if it’s manual and repetitive, it’s definitely fucking stupid.\"\n> — Every Dev Ever\n\n### The Magic\n\nYou don't need a complex CI\u002FCD pipeline to run a few scripts. You just need a file named `Makefile` and a dream.\n\n```makefile\nbuild:\n\tdocker build -t my-app .\n\nrun:\n\tdocker run -p 8080:8080 my-app\n\nclean:\n\tdocker system prune -f\n\n```\n\nNow, instead of remembering flags, you just type `make build`.\n\n### Scaling Up\n\nYou can use variables and shell commands inside your Makefile to handle the heavy lifting. Instead of hardcoding paths, let the script find them.\n\n```makefile\n# Variables are your friends\nSWIFT_FILES = $(shell find . -name \"*.swift\")\nBUNDLE_ID = com.example.App\n\n# Automate the boring stuff (like Plist generation)\napp: build\n\t@echo \"Creating app bundle...\"\n\tmkdir -p MyApp.app\u002FContents\u002FMacOS\n\tcp $(EXECUTABLE) MyApp.app\u002FContents\u002FMacOS\u002F\n\t@echo '\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>' > MyApp.app\u002FContents\u002FInfo.plist\n\t@echo '\u003Cdict>\u003Ckey>CFBundleIdentifier\u003C\u002Fkey>\u003Cstring>$(BUNDLE_ID)\u003C\u002Fstring>\u003C\u002Fdict>' >> MyApp.app\u002FContents\u002FInfo.plist\n```\n\n### Why this wins\n\n- **Variables:** Change your `BUNDLE_ID` once, and it updates everywhere.\n- **Phony Targets:** Use `.PHONY` to tell Make that `clean` or `run` aren't actual files, avoiding weird conflicts.\n- **Cleanup:** A single `make clean` that actually kills processes and wipes caches beats manual hunting every time.\n\n1. Define your environment variables.\n2. Automate the scaffolding (folders, plists, configs).\n3. Chain your commands (e.g., `dev: clean app`).\n\nStop fighting your tools and start making them work for you.\n\n### Why it stays\n\nIt’s language-agnostic. Whether you’re pushing Go code, compiling C, or just trying to manage a messy React project, Make doesn't care. It checks timestamps: if the file hasn't changed, it doesn't waste time rebuilding.\n\n1. Create a `Makefile`.\n2. Map your long commands to short aliases.\n3. Get back to actual work.\n\nDon't over-engineer your workflow when a 50-year-old tool solves it in two minutes.\n",1783267423469]