You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3KB

  1. PACKAGES = marbles/test stmlib/utils marbles/ramp marbles/random marbles stmlib/dsp
  2. VPATH = $(PACKAGES)
  3. TARGET = marbles_test
  4. BUILD_ROOT = build/
  5. BUILD_DIR = $(BUILD_ROOT)$(TARGET)/
  6. CC_FILES = marbles_test.cc \
  7. lag_processor.cc \
  8. output_channel.cc \
  9. quantizer.cc \
  10. discrete_distribution_quantizer.cc \
  11. ramp_extractor.cc \
  12. random.cc \
  13. resources.cc \
  14. units.cc \
  15. t_generator.cc \
  16. x_y_generator.cc
  17. OBJ_FILES = $(CC_FILES:.cc=.o)
  18. OBJS = $(patsubst %,$(BUILD_DIR)%,$(OBJ_FILES)) $(STARTUP_OBJ)
  19. DEPS = $(OBJS:.o=.d)
  20. DEP_FILE = $(BUILD_DIR)depends.mk
  21. all: marbles_test
  22. $(BUILD_DIR):
  23. mkdir -p $(BUILD_DIR)
  24. $(BUILD_DIR)%.o: %.cc
  25. g++ -c -DTEST -g -Wall -Werror -msse2 -Wno-unused-variable -O2 -I. $< -o $@
  26. $(BUILD_DIR)%.d: %.cc
  27. g++ -MM -DTEST -I. $< -MF $@ -MT $(@:.d=.o)
  28. marbles_test: $(OBJS)
  29. g++ -g -o $(TARGET) $(OBJS) -Wl,-no_pie -lm -lprofiler -L/opt/local/lib
  30. depends: $(DEPS)
  31. cat $(DEPS) > $(DEP_FILE)
  32. $(DEP_FILE): $(BUILD_DIR) $(DEPS)
  33. cat $(DEPS) > $(DEP_FILE)
  34. profile: marbles_test
  35. env CPUPROFILE_FREQUENCY=1000 CPUPROFILE=$(BUILD_DIR)/marbles.prof ./marbles_test && pprof --pdf ./marbles_test $(BUILD_DIR)/marbles.prof > profile.pdf && open profile.pdf
  36. clean:
  37. rm $(BUILD_DIR)*.*
  38. include $(DEP_FILE)