Browse Source

Make `dep` an order-only target of all objects

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
03c14d5bb6
4 changed files with 18 additions and 13 deletions
  1. +1
    -0
      Makefile
  2. +12
    -8
      compile.mk
  3. +1
    -5
      dep.mk
  4. +4
    -0
      plugin.mk

+ 1
- 0
Makefile View File

@@ -227,3 +227,4 @@ plugins:
for f in plugins/*; do (cd "$$f" && ${CMD}); done for f in plugins/*; do (cd "$$f" && ${CMD}); done


.PHONY: all dep run debug clean dist allplugins cleanplugins distplugins plugins .PHONY: all dep run debug clean dist allplugins cleanplugins distplugins plugins
.DEFAULT_GOAL := all

+ 12
- 8
compile.mk View File

@@ -43,29 +43,33 @@ 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
SOURCE_OBJECTS += $(patsubst %, build/%.o, $(SOURCES))
OBJECTS += $(patsubst %, build/%.o, $(SOURCES))
DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES)) DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES))



# Final targets # Final targets


$(TARGET): $(RESOURCES) $(OBJECTS) $(SOURCE_OBJECTS)
$(CXX) -o $@ $(SOURCE_OBJECTS) $(OBJECTS) $(LDFLAGS)
$(TARGET): $(OBJECTS)
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)


-include $(DEPENDENCIES) -include $(DEPENDENCIES)


build/%.c.o: %.c
build/%.c.o: %.c | dep
@mkdir -p $(@D) @mkdir -p $(@D)
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<


build/%.cpp.o: %.cpp
build/%.cpp.o: %.cpp | dep
@mkdir -p $(@D) @mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -c -o $@ $< $(CXX) $(CXXFLAGS) -c -o $@ $<


build/%.cc.o: %.cc
build/%.cc.o: %.cc | dep
@mkdir -p $(@D) @mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -c -o $@ $< $(CXX) $(CXXFLAGS) -c -o $@ $<


build/%.m.o: %.m
build/%.m.o: %.m | dep
@mkdir -p $(@D) @mkdir -p $(@D)
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<

# Do nothing by default
dep:

.PHONY: dep

+ 1
- 5
dep.mk View File

@@ -1,5 +1,6 @@
include $(RACK_DIR)/arch.mk include $(RACK_DIR)/arch.mk


# The install location for `make install`
DEP_LOCAL ?= . DEP_LOCAL ?= .
DEP_FLAGS += -g -O3 -march=nocona DEP_FLAGS += -g -O3 -march=nocona


@@ -28,10 +29,5 @@ $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)
$(DEPS): export LDFLAGS = $(DEP_LDFLAGS) $(DEPS): export LDFLAGS = $(DEP_LDFLAGS)


dep: $(DEPS) dep: $(DEPS)
@echo
@echo "#######################################"
@echo "# All dependencies built successfully #"
@echo "#######################################"
@echo


.PHONY: dep .PHONY: dep

+ 4
- 0
plugin.mk View File

@@ -29,6 +29,10 @@ ifeq ($(ARCH), win)
endif endif




DEP_FLAGS += -fPIC
include $(RACK_DIR)/dep.mk


all: $(TARGET) all: $(TARGET)


include $(RACK_DIR)/compile.mk include $(RACK_DIR)/compile.mk


Loading…
Cancel
Save