DIR_CORE = core/ SOURCES_CORE += core/math.c OBJECTS_CORE += $(SOURCES_CORE:.c=.o) LDFLAGS += -lm LDFLAGS_BSD += -lm OBJECTS_DIR_CORE += $(subst $(DIR_CORE),$(BUILD_DIR)$(DIR_CORE),$(OBJECTS_CORE)) OBJECTS += $(OBJECTS_CORE) OBJECTS_FINAL += $(OBJECTS_DIR_CORE)