ftpiiu_plugin/Makefile.linux
Michael Theall 86be27cd31 v3.0.0-rc1
2020-04-28 10:25:54 -05:00

37 lines
1.1 KiB
Makefile

TARGET := ftpd
BUILD := build.linux
CFILES := $(wildcard source/pc/*.c)
OFILES := $(patsubst source/%,$(BUILD)/%,$(CFILES:.c=.c.o))
CXXFILES := $(wildcard source/*.cpp source/imgui/*.cpp source/pc/*.cpp)
OXXFILES := $(patsubst source/%,$(BUILD)/%,$(CXXFILES:.cpp=.cpp.o))
CPPFLAGS := -g -Wall -pthread -Iinclude -Isource/pc \
`pkg-config --cflags gl glfw3` \
-DSTATUS_STRING="\"ftpd v$(VERSION)\"" \
-DIMGUI_DISABLE_INCLUDE_IMCONFIG_H=1 \
-DIMGUI_IMPL_OPENGL_LOADER_GLAD=1
CFLAGS := $(CPPFLAGS)
CXXFLAGS := $(CPPFLAGS) -std=gnu++17
LDFLAGS := -pthread `pkg-config --libs gl glfw3` -ldl
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OFILES) $(OXXFILES)
$(CXX) -o $@ $^ $(LDFLAGS)
$(OFILES): $(BUILD)/%.c.o : source/%.c
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(CC) -MMD -MP -MF $(BUILD)/$*.c.d $(CFLAGS) -c $< -o $@
$(OXXFILES): $(BUILD)/%.cpp.o : source/%.cpp
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(CXX) -MMD -MP -MF $(BUILD)/$*.c.d $(CXXFLAGS) -c $< -o $@
clean:
@$(RM) -r $(BUILD) $(TARGET)
-include $(shell find $(BUILD) -name \*.d 2>/dev/null)