ftpiiu_plugin/Makefile.linux

39 lines
1.2 KiB
Makefile
Raw Normal View History

2020-04-06 00:36:03 -05:00
TARGET := linux/ftpd
BUILD := linux/build
2020-04-05 14:16:16 -05:00
2020-04-06 00:36:03 -05:00
CFILES := $(wildcard source/linux/*.c)
CXXFILES := $(wildcard source/*.cpp source/imgui/*.cpp source/linux/*.cpp)
2020-04-17 15:32:39 -05:00
OFILES := $(patsubst source/%,$(BUILD)/%,$(CFILES:.c=.c.o))
2020-04-05 14:16:16 -05:00
OXXFILES := $(patsubst source/%,$(BUILD)/%,$(CXXFILES:.cpp=.cpp.o))
2020-04-06 00:36:03 -05:00
CPPFLAGS := -g -Wall -pthread -Iinclude -Isource/linux \
2020-04-05 14:16:16 -05:00
`pkg-config --cflags gl glfw3` \
-DSTATUS_STRING="\"ftpd v$(VERSION)\"" \
-DIMGUI_DISABLE_INCLUDE_IMCONFIG_H=1 \
2020-04-24 15:51:43 -05:00
-DIMGUI_IMPL_OPENGL_LOADER_GLAD=1 \
-DFTPDCONFIG="\"ftpd.cfg\""
2020-04-05 14:16:16 -05:00
CFLAGS := $(CPPFLAGS)
CXXFLAGS := $(CPPFLAGS) -std=gnu++17
LDFLAGS := -pthread `pkg-config --libs gl glfw3` -ldl
2014-11-25 00:13:47 -06:00
.PHONY: all clean
2020-04-05 14:16:16 -05:00
all: $(TARGET)
2014-11-25 00:13:47 -06:00
2020-04-05 14:16:16 -05:00
$(TARGET): $(OFILES) $(OXXFILES)
$(CXX) -o $@ $^ $(LDFLAGS)
2014-11-25 00:13:47 -06:00
2020-04-05 14:16:16 -05:00
$(OFILES): $(BUILD)/%.c.o : source/%.c
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(CC) -MMD -MP -MF $(BUILD)/$*.c.d $(CFLAGS) -c $< -o $@
2014-11-25 00:13:47 -06:00
2020-04-05 14:16:16 -05:00
$(OXXFILES): $(BUILD)/%.cpp.o : source/%.cpp
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(CXX) -MMD -MP -MF $(BUILD)/$*.c.d $(CXXFLAGS) -c $< -o $@
2014-11-25 00:13:47 -06:00
clean:
2020-04-05 14:16:16 -05:00
@$(RM) -r $(BUILD) $(TARGET)
-include $(shell find $(BUILD) -name \*.d 2>/dev/null)