makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. SRC = ..\src
  2. CC = arm-linux-gnueabihf-g++.exe
  3. CFLAGS = -g -Wall -fpermissive
  4. LIBS = -lsqlite3 -pthread -lpigpio -lrt
  5. _DEPS = common.h daemon.h ini.h \
  6. INIReader.h log.h RCSwitch.h server.h \
  7. discovery.h
  8. DEPS = $(patsubst %,$(SRC)\\%,$(_DEPS))
  9. _OBJ = common.o log.o server.o \
  10. RCSwitch.o daemon.o ini.o \
  11. INIReader.o discovery.o
  12. OBJ = $(patsubst %,$(SRC)\\%,$(_OBJ))
  13. all: kisslight
  14. %.o: %.cpp $(DEPS)
  15. $(CC) -c -o $@ $< $(CFLAGS)
  16. kisslight: $(OBJ)
  17. $(CC) $(CFLAGS) $(LIBS) $^ -o ..\$@
  18. install: kisslight
  19. cp resources/kisslight.ini /etc/
  20. cp resources/kisslight.service /etc/systemd/system/
  21. cp kisslight /usr/bin/
  22. mkdir /var/lib/kisslight
  23. sqlite3 /var/lib/kisslight/kisslight.db < resources/server-db.sql
  24. systemctl daemon-reload
  25. systemctl start kisslight.service
  26. systemctl enable kisslight.service
  27. uninstall:
  28. systemctl stop kisslight.service
  29. systemctl disable kisslight.service
  30. rm -f /etc/kisslight.ini /etc/systemd/system/kisslight.service /usr/bin/kisslight
  31. rm -rf /var/lib/kisslight
  32. systemctl daemon-reload
  33. .PHONY: clean
  34. clean:
  35. del /f $(SRC)\*.o ..\kisslight