Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. CC := g++
  2. CFLAGS := -O3
  3. LFLAGS := -L/opt/lib -lpthread -lcrypto -lcurl -lboost_regex -lboost_filesystem -lboost_system -ljpeg
  4. ifeq ($(BUILD),debug)
  5. # Debug flags
  6. CFLAGS += -O0 -g
  7. endif
  8. ifeq ($(BUILD),release)
  9. # Optimization flags valid for Intel Atom (DS1813+)
  10. CFLAGS += -march=prescott -mtune=pentium -mfpmath=sse -O3 -s -DNDEBUG
  11. endif
  12. %.o: %.cpp
  13. $(CC) -c $(CFLAGS) $< -o $@
  14. AlarmServer: main.cpp server.o connection.o protocol.o message.o mimeImage.o outputImage.o inputImage.o util.o httpClient.o base64.o
  15. g++ -o AlarmServer main.cpp server.o connection.o protocol.o message.o mimeImage.o outputImage.o inputImage.o util.o httpClient.o base64.o $(LFLAGS) $(LDFLAGS) $(CFLAGS)
  16. server.o: server.cpp server.h connection.h protocol.h util.h httpClient.h
  17. connection.o: connection.cpp connection.h protocol.h util.h httpClient.h
  18. protocol.o: protocol.cpp protocol.h util.h httpClient.h
  19. message.o: message.cpp message.h mimeImage.h outputImage.h inputImage.h util.h httpClient.h base64.h
  20. mimeImage.o: mimeImage.cpp mimeImage.h outputImage.h inputImage.h base64.h
  21. outputImage.o: outputImage.cpp outputImage.h inputImage.h
  22. inputImage.o: inputImage.cpp inputImage.h
  23. util.o: util.cpp util.h httpClient.h
  24. httpClient.o: httpClient.cpp httpClient.h
  25. base64.o: base64.cpp base64.h
  26. all: AlarmServer
  27. debug:
  28. make "BUILD=debug"
  29. release:
  30. make "BUILD=release"
  31. clean:
  32. -rm *.o AlarmServer