Makefile and vcxproj file updates. Also modified vcxproj files so that the various files ispc generates go into $(TargetDir), not the current directory. Modified the ray tracer example to not have uniform short-vector types in its app-visible datatypes (these are laid out differently on SSE vs AVX); there was an existing lurking bug in the way this was done before.
40 lines
860 B
Makefile
40 lines
860 B
Makefile
|
|
ARCH = $(shell uname)
|
|
|
|
TASK_CXX=../tasksys.cpp
|
|
TASK_LIB=-lpthread
|
|
TASK_OBJ=$(addprefix objs/, $(subst ../,, $(TASK_CXX:.cpp=.o)))
|
|
|
|
CXX=g++
|
|
CXXFLAGS=-Iobjs/ -O3 -Wall -m64
|
|
ISPC=ispc
|
|
ISPCFLAGS=-O2 --target=sse2,sse4-x2,avx --arch=x86-64
|
|
|
|
OBJS=objs/stencil.o objs/stencil_serial.o $(TASK_OBJ) objs/stencil_ispc.o \
|
|
objs/stencil_ispc_sse2.o objs/stencil_ispc_sse4.o \
|
|
objs/stencil_ispc_avx.o
|
|
|
|
default: stencil
|
|
|
|
.PHONY: dirs clean
|
|
|
|
dirs:
|
|
/bin/mkdir -p objs/
|
|
|
|
clean:
|
|
/bin/rm -rf objs *~ stencil
|
|
|
|
stencil: dirs $(OBJS)
|
|
$(CXX) $(CXXFLAGS) -o $@ $(OBJS) -lm $(TASK_LIB)
|
|
|
|
objs/%.o: %.cpp
|
|
$(CXX) $< $(CXXFLAGS) -c -o $@
|
|
|
|
objs/%.o: ../%.cpp
|
|
$(CXX) $< $(CXXFLAGS) -c -o $@
|
|
|
|
objs/stencil.o: objs/stencil_ispc.h
|
|
|
|
objs/%_ispc.h objs/%_ispc.o objs/%_ispc_sse2.o objs/%_ispc_sse4.o objs/%_ispc_avx.o: %.ispc
|
|
$(ISPC) $(ISPCFLAGS) $< -o objs/$*_ispc.o -h objs/$*_ispc.h
|