Makefile 691 B

12345678910111213141516171819202122232425262728293031
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. #
  3. # Copyright (C) 2022, 2023 Ferass El Hafidi <vitali64pmemail@protonmail.com>
  4. # Copyright (C) 2022 Leah Rowe <leah@libreboot.org>
  5. include ../config.mk
  6. # Commands
  7. # ========
  8. all: clean sh
  9. sh: sh.o
  10. $(CC) $(CFLAGS) *.o -o sh
  11. rm -f version.h
  12. clean:
  13. rm -f *.o
  14. rm -Rf sh
  15. # Utilities
  16. # =========
  17. sh.o:
  18. echo "#ifndef VERSION_H" > version.h
  19. echo "#define VERSION_H" >> version.h
  20. echo "#define COMPILETIME \"$$(date)\"" >> version.h
  21. echo >> version.h
  22. echo "#endif" >> version.h
  23. for s in *.c; do $(CC) $(CFLAGS) $(NOLINKER) $$s -o $${s%.c}.o; done