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.

57 lines
960B

  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. FLAGS += -DSLUG=$(SLUG)
  8. FLAGS += -fPIC
  9. FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include
  10. include $(RACK_DIR)/arch.mk
  11. ifeq ($(ARCH), lin)
  12. LDFLAGS += -shared
  13. TARGET = plugin.so
  14. endif
  15. ifeq ($(ARCH), mac)
  16. LDFLAGS += -shared -undefined dynamic_lookup
  17. TARGET = plugin.dylib
  18. endif
  19. ifeq ($(ARCH), win)
  20. LDFLAGS += -shared -L$(RACK_DIR) -lRack
  21. TARGET = plugin.dll
  22. endif
  23. all: $(TARGET)
  24. include $(RACK_DIR)/compile.mk
  25. clean:
  26. rm -rfv build $(TARGET) dist
  27. dist: all
  28. rm -rf dist
  29. mkdir -p dist/$(SLUG)
  30. # Strip and copy plugin binary
  31. cp $(TARGET) dist/$(SLUG)/
  32. ifeq ($(ARCH), mac)
  33. strip -x dist/$(SLUG)/$(TARGET)
  34. else
  35. strip -s dist/$(SLUG)/$(TARGET)
  36. endif
  37. # Copy distributables
  38. cp -R $(DISTRIBUTABLES) dist/$(SLUG)/
  39. # Create ZIP package
  40. cd dist && zip -5 -r $(SLUG)-$(VERSION)-$(ARCH).zip $(SLUG)
  41. .PHONY: clean dist
  42. .DEFAULT_GOAL := all