chundoong-lab-ta/APWS23/project/Makefile

27 lines
554 B
Makefile
Raw Normal View History

2023-02-01 22:30:00 +09:00
TARGET=main
2023-02-02 19:02:36 +09:00
OBJECTS=main.o util.o uNet.o tensor.o
2023-02-01 22:30:00 +09:00
CFLAGS=-std=c++14 -O3 -Wall -march=native -mavx2 -mfma -mno-avx512f -fopenmp -I/usr/local/cuda/include
CUDA_CFLAGS:=$(foreach option, $(CFLAGS),-Xcompiler=$(option))
LDFLAGS=-pthread -L/usr/local/cuda/lib64
LDLIBS= -lstdc++ -lcudart -lm
CXX=g++
CUX=/usr/local/cuda/bin/nvcc
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
%.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $^
%.o: %.cu
$(CUX) $(CUDA_CFLAGS) -c -o $@ $^
clean:
rm -rf $(TARGET) $(OBJECTS)