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.

63 lines
1.0KB

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