Parcourir la source

DEV: Makefile added

master
Christos Houtouridis il y a 5 ans
Parent
révision
d704502c01
1 fichiers modifiés avec 57 ajouts et 0 suppressions
  1. +57
    -0
      Makefile

+ 57
- 0
Makefile Voir le fichier

@@ -0,0 +1,57 @@
#
# RTES_final makefile
#
# Author: Christos Choutouridis AEM:8997
# email: cchoutou@ece.auth.gr
#
#
# select one of the following or edit for your environment
#
#CXX := /usr/local/arm/bin/arm-unknown-linux-gnueabi-gcc
CXX := D:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gcc.exe
CXXFLAGS := -std=c11 -Wall -Wextra -Werror
CXXFEXTR := -c -fmessage-length=0
LDFLAGS := -lm -lpthread
BUILD := ./bin
OBJ_DIR := $(BUILD)/obj
APP_DIR := $(BUILD)
TARGET := rtes_final
SRC := $(wildcard src/*.c)
OBJECTS := $(SRC:%.c=$(OBJ_DIR)/%.o)
$(OBJ_DIR)/%.o: %.c
@mkdir -p $(@D)
$(CXX) $(CXXFEXTR) $(CXXFLAGS) -o $@ -c $<
$(APP_DIR)/$(TARGET): $(OBJECTS)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(APP_DIR)/$(TARGET) $(OBJECTS)
# === Rules ===
rtes_final: build $(APP_DIR)/$(TARGET)
build:
@mkdir -p $(APP_DIR)
@mkdir -p $(OBJ_DIR)
debug: CXXFLAGS += -DDEBUG -g3
debug: rtes_final
release: CXXFLAGS += -O2
release: rtes_final
upload:
scp $(BUILD)/$(TARGET) root@192.168.0.1:/root/
clean:
-@rm -rvf $(OBJ_DIR)/*
-@rm -rvf $(APP_DIR)/*
all: clean release upload
.PHONY: rtes_final build debug release upload clean all

Chargement…
Annuler
Enregistrer