Open fatalfeel opened 2 years ago
TARGET = asm_test
CROSS_COMPILE = /opt/ivot/arm-ca9-linux-gnueabihf-6.5/bin/arm-ca9-linux-gnueabihf- CXX = $(CROSS_COMPILE)g++
CXXFLAGS = -O0 -g -fPIC -Wall -fmessage-length=0 -std=c++14 -pthread -fopenmp LDFLAGS = -lgcov -lpthread COMPILE_DIR = ./objs
$(COMPILE_DIR)/%.o : ./%.cpp @mkdir -p $(@D) $(CXX) $(CXXFLAGS) -c $< -o $@
SRC = $(notdir $(wildcard ./*.cpp)) OBJ = $(patsubst %.cpp,$(COMPILE_DIR)/%.o,$(SRC))
$(TARGET) : $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
all: $(TARGET)
clean: rm -rf $(COMPILE_DIR) $(TARGET)
################################################### could SConstruct to Makefile it is more easier to compile
prototype https://www.mediafire.com/file/a9i1rzzknqqhqvx/test_submake.tar.gz
i will do it later and then share Makefile version
this is my Makefile for x64 and arm32
TARGET = asm_test
CROSS_COMPILE =
CROSS_COMPILE = /opt/ivot/arm-ca9-linux-gnueabihf-6.5/bin/arm-ca9-linux-gnueabihf- CXX = $(CROSS_COMPILE)g++
CXXFLAGS = -O0 -g -fPIC -Wall -fmessage-length=0 -std=c++14 -pthread -fopenmp LDFLAGS = -lgcov -lpthread COMPILE_DIR = ./objs
$(COMPILE_DIR)/%.o : ./%.cpp @mkdir -p $(@D) $(CXX) $(CXXFLAGS) -c $< -o $@
SRC = $(notdir $(wildcard ./*.cpp)) OBJ = $(patsubst %.cpp,$(COMPILE_DIR)/%.o,$(SRC))
$(TARGET) : $(OBJ) $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
all: $(TARGET)
clean: rm -rf $(COMPILE_DIR) $(TARGET)
################################################### could SConstruct to Makefile it is more easier to compile