| # Copyright (C) 2016 The Android Open Source Project |
| # |
| # Licensed under the Apache License, Version 2.0 (the \"License\"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an \"AS IS\" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| CC=g++ |
| CC_FLAGS=-std=c++11 |
| |
| toolsdir=../third_party/khronos/SPIRV-Tools/ |
| glslanglibdir=../third_party/khronos/glslang/build/install/lib/ |
| crosslibdir=../third_party/khronos/SPIRV-Cross/ |
| toolslibdir=$(toolsdir)build/source/ |
| |
| glslanglibs=$(addprefix $(glslanglibdir), libglslang.a libHLSL.a libSPIRV.a libOGLCompiler.a libOSDependent.a) |
| crosslibs=$(addprefix $(crosslibdir), libspirv-cross.a) |
| toolslibs=$(addprefix $(toolslibdir), opt/libSPIRV-Tools-opt.a libSPIRV-Tools.a) |
| |
| libs=-Wl,$(glslanglibs) $(crosslibs) $(toolslibs) |
| includedirs=-I $(toolsdir)include -I $(toolsdir)external/spirv-headers/include -I .. |
| |
| objects=main.o libmanager.o SpvManager.o NameManager.o common.o |
| |
| dis_objects=disassemble_test.o libmanager.o SpvManager.o NameManager.o common.o |
| |
| |
| all: main disassemble_test |
| |
| main: $(objects) |
| $(CC) $(CC_FLAGS) $(objects) $(includedirs) $(libs) -pthread -o main |
| |
| disassemble_test: $(dis_objects) |
| $(CC) $(CC_FLAGS) $(dis_objects) $(includedirs) $(libs) -pthread -o disassemble_test |
| |
| main.o: main.cpp libmanager.h |
| $(CC) $(CC_FLAGS) -c main.cpp $(includedirs) |
| |
| disassemble_test.o: main.cpp libmanager.h |
| $(CC) $(CC_FLAGS) -c disassemble_test.cpp $(includedirs) |
| |
| SpvManager.o: SpvManager.cpp SpvManager.h libmanager.h NameManager.h common.h |
| $(CC) $(CC_FLAGS) -c SpvManager.cpp $(includedirs) |
| |
| NameManager.o: NameManager.cpp NameManager.h common.h libmanager.h |
| $(CC) $(CC_FLAGS) -c NameManager.cpp $(includedirs) |
| |
| common.o: common.cpp common.h |
| $(CC) $(CC_FLAGS) -c common.cpp |
| |
| libmanager.o: libmanager.cpp libmanager.h |
| $(CC) $(CC_FLAGS) -c libmanager.cpp $(includedirs) |
| |
| clean: |
| rm -f $(objects) main |