Sign inSign up free

819. A Makefile That Lies About Being Up to Date

medium 20 XP ~10 minHands-on lab

CI builds inventory-api with the Makefile in /home/student/repos/inventory-api:

$ make
Makefile:5: *** missing separator.  Stop.
$ make test
make: 'test' is up to date.

Task

Fix the Makefile (don't change scripts/) so that:

  • make (no target) is the same as make build: it runs scripts/lint.sh first, then writes build/app containing app <VERSION>; if lint fails, nothing is built and make fails,
  • make test always runs scripts/test.sh, even though a test/ directory exists,
  • make release runs the tests and the build, then creates build/app-<VERSION>.tar.gz containing app,
  • VERSION defaults to 1.0.0 but can come from the environment: VERSION=2.1.0 make release creates build/app-2.1.0.tar.gz with app 2.1.0 inside,
  • make clean removes build/.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of CI/CD Pipelines in Practice. Next step: Stamp the Build With Its Version

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.