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.

61 lines
1011B

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