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.

69 lines
1.9KB

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