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.

68 lines
1.2KB

  1. ifndef RACK_DIR
  2. $(error RACK_DIR is not defined)
  3. endif
  4. ifndef SLUG
  5. $(error SLUG is not defined)
  6. endif
  7. STRIP ?= strip
  8. FLAGS += -DSLUG=$(SLUG)
  9. FLAGS += -fPIC
  10. FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include
  11. include $(RACK_DIR)/arch.mk
  12. ifeq ($(ARCH), lin)
  13. LDFLAGS += -shared
  14. TARGET := plugin.so
  15. RACK_USER_DIR ?= $(HOME)/.Rack
  16. endif
  17. ifeq ($(ARCH), mac)
  18. LDFLAGS += -shared -undefined dynamic_lookup
  19. TARGET := plugin.dylib
  20. RACK_USER_DIR ?= $(HOME)/Documents/Rack
  21. endif
  22. ifeq ($(ARCH), win)
  23. LDFLAGS += -shared -L$(RACK_DIR) -lRack
  24. TARGET := plugin.dll
  25. RACK_USER_DIR ?= $(USERPROFILE)/Documents/Rack
  26. endif
  27. DEP_FLAGS += -fPIC
  28. include $(RACK_DIR)/dep.mk
  29. all: $(TARGET)
  30. include $(RACK_DIR)/compile.mk
  31. clean:
  32. rm -rfv build $(TARGET) dist
  33. dist: all
  34. rm -rf dist
  35. mkdir -p dist/$(SLUG)
  36. # Strip and copy plugin binary
  37. cp $(TARGET) dist/$(SLUG)/
  38. ifeq ($(ARCH), mac)
  39. $(STRIP) -S dist/$(SLUG)/$(TARGET)
  40. else
  41. $(STRIP) -s dist/$(SLUG)/$(TARGET)
  42. endif
  43. # Copy distributables
  44. cp -R $(DISTRIBUTABLES) dist/$(SLUG)/
  45. # Create ZIP package
  46. cd dist && zip -5 -r $(SLUG)-$(VERSION)-$(ARCH).zip $(SLUG)
  47. install: dist
  48. cp dist/$(SLUG)-$(VERSION)-$(ARCH).zip $(RACK_USER_DIR)/plugins/
  49. .PHONY: clean dist
  50. .DEFAULT_GOAL := all