individual targetspull/1639/head
| @@ -7,8 +7,8 @@ | |||||
| - Added velocity mode to MIDI-Trig | - Added velocity mode to MIDI-Trig | ||||
| - Added MIDI multiplexing so multiple MIDI modules can use the same MIDI device on Windows | - Added MIDI multiplexing so multiple MIDI modules can use the same MIDI device on Windows | ||||
| - Made Module Browser layout more compact | - Made Module Browser layout more compact | ||||
| - Add power meter | |||||
| - Add icons to toolbar | |||||
| - Added power meter | |||||
| - Added icons to toolbar | |||||
| - [VCV Bridge](https://vcvrack.com/manual/Bridge.html) 0.6.1 | - [VCV Bridge](https://vcvrack.com/manual/Bridge.html) 0.6.1 | ||||
| - Replaced VST effect plugin with VST instrument plugin with audio inputs | - Replaced VST effect plugin with VST instrument plugin with audio inputs | ||||
| - Added MIDI support | - Added MIDI support | ||||
| @@ -8,6 +8,9 @@ endif | |||||
| include $(RACK_DIR)/arch.mk | include $(RACK_DIR)/arch.mk | ||||
| LD ?= ld | |||||
| OBJCOPY ?= objcopy | |||||
| FLAGS += -DVERSION=$(VERSION) | FLAGS += -DVERSION=$(VERSION) | ||||
| # Generate dependency files alongside the object files | # Generate dependency files alongside the object files | ||||
| FLAGS += -MMD -MP | FLAGS += -MMD -MP | ||||
| @@ -44,6 +47,7 @@ CXXFLAGS += $(FLAGS) | |||||
| # Derive object files from sources and place them before user-defined objects | # Derive object files from sources and place them before user-defined objects | ||||
| OBJECTS := $(patsubst %, build/%.o, $(SOURCES)) $(OBJECTS) | OBJECTS := $(patsubst %, build/%.o, $(SOURCES)) $(OBJECTS) | ||||
| OBJECTS += $(patsubst %, build/%.bin.o, $(BINARIES)) | |||||
| DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES)) | DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES)) | ||||
| # Final targets | # Final targets | ||||
| @@ -53,23 +57,23 @@ $(TARGET): $(OBJECTS) | |||||
| -include $(DEPENDENCIES) | -include $(DEPENDENCIES) | ||||
| build/%.c.o: %.c | dep | |||||
| build/%.c.o: %.c | |||||
| @mkdir -p $(@D) | @mkdir -p $(@D) | ||||
| $(CC) $(CFLAGS) -c -o $@ $< | $(CC) $(CFLAGS) -c -o $@ $< | ||||
| build/%.cpp.o: %.cpp | dep | |||||
| build/%.cpp.o: %.cpp | |||||
| @mkdir -p $(@D) | @mkdir -p $(@D) | ||||
| $(CXX) $(CXXFLAGS) -c -o $@ $< | $(CXX) $(CXXFLAGS) -c -o $@ $< | ||||
| build/%.cc.o: %.cc | dep | |||||
| build/%.cc.o: %.cc | |||||
| @mkdir -p $(@D) | @mkdir -p $(@D) | ||||
| $(CXX) $(CXXFLAGS) -c -o $@ $< | $(CXX) $(CXXFLAGS) -c -o $@ $< | ||||
| build/%.m.o: %.m | dep | |||||
| build/%.m.o: %.m | |||||
| @mkdir -p $(@D) | @mkdir -p $(@D) | ||||
| $(CC) $(CFLAGS) -c -o $@ $< | $(CC) $(CFLAGS) -c -o $@ $< | ||||
| # Dummy target | |||||
| dep: | |||||
| .PHONY: dep | |||||
| build/%.bin.o: % | |||||
| @mkdir -p $(@D) | |||||
| $(LD) -r -b binary -o $@ $< | |||||
| $(OBJCOPY) --rename-section .data=.rodata,alloc,load,readonly,data,contents $@ $@ | |||||
| @@ -55,6 +55,25 @@ Example: | |||||
| #define DEPRECATED __attribute__ ((deprecated)) | #define DEPRECATED __attribute__ ((deprecated)) | ||||
| /** References binary files compiled into the program. | |||||
| For example, to include a file "Test.dat" directly into your program binary, add | |||||
| BINARIES += Test.dat | |||||
| to your Makefile and declare | |||||
| BINARY(Test_dat); | |||||
| at the root of a .c or .cpp source file. Note that special characters are replaced with "_". Then use | |||||
| BINARY_START(Test_dat) | |||||
| BINARY_END(Test_dat) | |||||
| to reference the data beginning and end as a void* array and | |||||
| BINARY_SIZE(Test_dat) | |||||
| to get its size in bytes. | |||||
| */ | |||||
| #define BINARY(sym) extern char _binary_##sym##_start, _binary_##sym##_end, _binary_##sym##_size | |||||
| #define BINARY_START(sym) ((void *) &_binary_##sym##_start) | |||||
| #define BINARY_END(sym) ((void *) &_binary_##sym##_end) | |||||
| // The symbol "_binary_##sym##_size" doesn't seem to be valid after a plugin is dynamically loaded, so simply take the difference between the two addresses. | |||||
| #define BINARY_SIZE(sym) ((size_t) (&_binary_##sym##_end - &_binary_##sym##_start)) | |||||
| #include "util/math.hpp" | #include "util/math.hpp" | ||||