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.

67 lines
1.8KB

  1. # makefile fragment to make test.exe, the unit test program.
  2. #include "../../arch.mk"
  3. include $(RACK_DIR)/arch.mk
  4. TEST_SOURCES = $(wildcard test/*.cpp)
  5. TEST_SOURCES += $(wildcard dsp/**/*.cpp)
  6. TEST_SOURCES += $(wildcard dsp/third-party/falco/*.cpp)
  7. TEST_SOURCES += $(wildcard sqsrc/**/*.cpp)
  8. TEST_SOURCES += dsp/third-party/kiss_fft130/tools/kiss_fftr.c
  9. TEST_SOURCES += dsp/third-party/kiss_fft130/kiss_fft.c
  10. ## This is a list of full paths to the .o files we want to build
  11. TEST_OBJECTS = $(patsubst %, build_test/%.o, $(TEST_SOURCES))
  12. build_test/%.cpp.o: %.cpp
  13. mkdir -p $(@D)
  14. $(CXX) $(CXXFLAGS) -c -o $@ $<
  15. build_test/%.c.o: %.c
  16. mkdir -p $(@D)
  17. $(CXX) $(CXXFLAGS) -c -o $@ $<
  18. # Always define _PERF for the perf tests.
  19. perf.exe : PERFFLAG = -D _PERF
  20. # Turn off asserts for perf, unless user overrides on command line
  21. perf.exe : FLAGS += $(ASSERTOFF)
  22. FLAGS += $(PERFFLAG)
  23. ifeq ($(ARCH), win)
  24. # don't need these yet
  25. # -lcomdlg32 -lole32 -ldsound -lwinmm
  26. test.exe perf.exe : LDFLAGS = -static \
  27. -mwindows \
  28. -lpthread -lopengl32 -lgdi32 -lws2_32
  29. endif
  30. ifeq ($(ARCH), lin)
  31. test.exe perf.exe : LDFLAGS = -rdynamic \
  32. -lpthread -lGL -ldl \
  33. $(shell pkg-config --libs gtk+-2.0)
  34. endif
  35. ifeq ($(ARCH), mac)
  36. test.exe perf.exe : LDFLAGS = -stdlib=libc++ -lpthread -ldl \
  37. -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo
  38. endif
  39. test : test.exe
  40. ## Note that perf and test targets both used build_test for object files,
  41. ## So you need to be careful to delete/clean when switching between the two.
  42. ## Consider fixing this in the future.
  43. perf : perf.exe
  44. ## cleantest will clean out all the test and perf build products
  45. cleantest :
  46. rm -rfv build_test
  47. rm -fv test.exe
  48. rm -fv perf.exe
  49. test.exe : $(TEST_OBJECTS)
  50. $(CXX) -o $@ $^ $(LDFLAGS)
  51. perf.exe : $(TEST_OBJECTS)
  52. $(CXX) -o $@ $^ $(LDFLAGS)