A messenger application for Raspberry Pi Zerofor A.U.TH (Real time Embedded systems).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.7 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #
  2. # RTES_final makefile
  3. #
  4. # Author: Christos Choutouridis AEM:8997
  5. # email: cchoutou@ece.auth.gr
  6. #
  7. #
  8. # Edit the paths to match your environment
  9. # Currently supported:
  10. # Windows (we prefer Cygwin)
  11. # GNU/Linux
  12. #
  13. LINUX_CXX := /usr/local/bin/cross-pi0/bin/arm-linux-gnueabihf-gcc
  14. WIN_CXX := D:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gcc.exe
  15. # RTES related stuff for upload
  16. SCP := scp
  17. PIUSER := root
  18. PI := 192.168.0.1
  19. RTES_PATH := /usr/local/bin/
  20. # === Compilation related stuff ===
  21. CXXFLAGS := -std=c11 -Wall -Wextra -Werror
  22. CXXFEXTR := -c -fmessage-length=0
  23. LDFLAGS := -lm -lpthread
  24. BUILD := ./bin
  25. OBJ_DIR := $(BUILD)/obj
  26. APP_DIR := $(BUILD)
  27. TARGET := rtes_final
  28. SRC := $(wildcard src/*.c)
  29. # === OS selection ===
  30. ifeq ($(OS),Windows_NT)
  31. # Windows, select exe path
  32. CXX := $(WIN_CXX)
  33. else
  34. # Linux filter [currently only GNU/Linux]
  35. UNAME := $(shell uname)
  36. ifeq ($(UNAME),Linux)
  37. CXX := $(LINUX_CXX)
  38. else
  39. ERR := $(error Not supporting OS)
  40. endif
  41. endif
  42. # === MakeFile body ===
  43. OBJECTS := $(SRC:%.c=$(OBJ_DIR)/%.o)
  44. $(OBJ_DIR)/%.o: %.c
  45. @mkdir -p $(@D)
  46. $(CXX) $(CXXFEXTR) $(CXXFLAGS) -o $@ -c $<
  47. $(APP_DIR)/$(TARGET): $(OBJECTS)
  48. @mkdir -p $(@D)
  49. $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(APP_DIR)/$(TARGET) $(OBJECTS)
  50. # === Rules ===
  51. rtes_final: build $(APP_DIR)/$(TARGET)
  52. clean:
  53. -@rm -rvf $(OBJ_DIR)/*
  54. -@rm -rvf $(APP_DIR)/*
  55. build:
  56. @mkdir -p $(APP_DIR)
  57. @mkdir -p $(OBJ_DIR)
  58. debug: CXXFLAGS += -DDEBUG -g3
  59. debug: rtes_final
  60. release: CXXFLAGS += -O2
  61. release: rtes_final
  62. upload:
  63. $(SCP) $(BUILD)/$(TARGET) $(PIUSER)@$(PI):$(RTES_PATH)
  64. all: clean release upload
  65. .PHONY: rtes_final build debug release upload clean all