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.

49 lines
1.2KB

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