Makefile 639 B

12345678910111213141516171819202122232425262728
  1. # SPDX-FileCopyrightText: 2019 Helmut Pozimski <helmut@pozimski.eu>
  2. #
  3. # SPDX-License-Identifier: GPL-2.0-only
  4. CC ?= gcc
  5. CFLAGS ::= $(CFLAGS) -std=c99 -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -D_POSIX_C_SOURCE -Wall -pedantic
  6. DEPS = src/wavfile.h src/tcpserver.h build
  7. PREFIX ?= /usr/local
  8. build/%.o: src/%.c $(DEPS)
  9. $(CC) -c -o $@ $< $(CFLAGS)
  10. build/tpr: build/wavfile.o build/main.o build/tcpserver.o
  11. $(CC) -o build/tpr build/wavfile.o build/main.o build/tcpserver.o
  12. build:
  13. mkdir build
  14. all:
  15. build/tpr
  16. .PHONY: clean
  17. clean:
  18. rm -f build/*.o
  19. rm -f build/tpr
  20. install: build/tpr
  21. install -m 0755 -s build/tpr $(PREFIX)/bin