Makefile 596 B

12345678910111213141516171819202122232425
  1. CFLAGS=-c -Wall -O2
  2. LIBS = -lm -lpthread -larmbianio -lpaho-mqtt3c
  3. CFLAGS += $(shell pkg-config --cflags json-c)
  4. LIBS += $(shell pkg-config --libs json-c)
  5. all: libarmbianio.a max7219.o main.o
  6. $(CC) main.o max7219.o $(LIBS) -o build
  7. main.o: main.c types.h helper.h
  8. $(CC) $(CFLAGS) main.c
  9. max7219.o: max7219.c
  10. $(CC) $(CFLAGS) max7219.c
  11. libarmbianio.a: armbianio.o
  12. ar -rc libarmbianio.a armbianio.o ;\
  13. sudo cp libarmbianio.a /usr/local/lib ;\
  14. sudo cp armbianio.h /usr/local/include
  15. armbianio.o: armbianio.c
  16. $(CC) $(CFLAGS) armbianio.c
  17. clean:
  18. rm *.o *.a build