2020-03-31 22:35:56 +02:00
|
|
|
TARGET ?= dazibao
|
|
|
|
SRC_DIRS ?= ./src/*
|
2020-03-31 22:47:48 +02:00
|
|
|
CC := gcc -Wall -lssl -lcrypto
|
2020-03-31 22:35:56 +02:00
|
|
|
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)
|
|
|
|
OBJS := $(addsuffix .o,$(basename $(SRCS)))
|
|
|
|
DEPS := $(OBJS:.o=.d)
|
|
|
|
|
|
|
|
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
|
|
|
|
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) $(TARGET) $(OBJS) $(DEPS)
|
|
|
|
|
|
|
|
-include $(DEPS)
|