Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. SOURCES=$(filter-out siftdump.cc,$(wildcard *.cc))
  2. OBJECTS=$(patsubst %.cc,%.o,$(SOURCES))
  3. TARGET=libsift.a
  4. include ../common/Makefile.common
  5. ifeq ($(SNIPER_TARGET_ARCH),intel64)
  6. CXXFLAGS_ARCH=
  7. else
  8. ifeq ($(SNIPER_TARGET_ARCH),ia32)
  9. CXXFLAGS_ARCH=-m32
  10. else
  11. $(error unknown SNIPER_TARGET_ARCH $(SNIPER_TARGET_ARCH))
  12. endif
  13. endif
  14. all : $(TARGET) siftdump recorder
  15. .PHONY : recorder
  16. include ../common/Makefile.common
  17. XED_HOME=$(wildcard $(PIN_HOME)/extras/xed-$(SNIPER_TARGET_ARCH) $(PIN_HOME)/extras/xed2-$(SNIPER_TARGET_ARCH))
  18. CXXFLAGS+=-fPIC -I$(XED_HOME)/include $(CXXFLAGS_ARCH)
  19. %.o : %.cc $(wildcard *.h) Makefile
  20. $(_MSG) '[CXX ]' $(subst $(shell readlink -f $(SIM_ROOT))/,,$(shell readlink -f $@))
  21. $(_CMD) $(CXX) -c -o $@ $< $(CXXFLAGS)
  22. $(TARGET) : $(OBJECTS)
  23. $(_MSG) '[AR ]' $(subst $(shell readlink -f $(SIM_ROOT))/,,$(shell readlink -f $@))
  24. $(_CMD) $(AR) rcs $@ $^
  25. siftdump : siftdump.o $(TARGET)
  26. $(_MSG) '[CXX ]' $(subst $(shell readlink -f $(SIM_ROOT))/,,$(shell readlink -f $@))
  27. $(_CMD) $(CXX) $(CXXFLAGS_ARCH) -o $@ $^ -L$(XED_HOME)/lib -L. -lsift -lxed -lz
  28. recorder : $(TARGET)
  29. @$(MAKE) $(MAKE_QUIET) -C recorder
  30. clean :
  31. $(_CMD) rm -f *.o *.d $(TARGET) siftdump
  32. $(_MSG) '[CLEAN ] sift/recorder'
  33. $(_CMD) $(MAKE) $(MAKE_QUIET) -C recorder clean
  34. ifneq ($(CLEAN),clean)
  35. -include $(patsubst %.cc,%.d,$(SOURCES))
  36. endif