2020-03-31 22:35:56 +02:00
|
|
|
TARGET ?= dazibao
|
|
|
|
SRC_DIRS ?= ./src/*
|
2020-04-14 16:59:49 +02:00
|
|
|
CC := gcc
|
2020-04-16 15:08:22 +02:00
|
|
|
CFLAGS= -O2 -Wall
|
2020-04-14 16:59:49 +02:00
|
|
|
SRCS := $(shell find $(SRC_DIRS) -name *.c -or -name *.s)
|
2020-03-31 22:35:56 +02:00
|
|
|
OBJS := $(addsuffix .o,$(basename $(SRCS)))
|
|
|
|
DEPS := $(OBJS:.o=.d)
|
2020-04-16 15:08:22 +02:00
|
|
|
SSLFLAGS = -lssl -lcrypto
|
2020-03-31 22:35:56 +02:00
|
|
|
|
|
|
|
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
|
|
|
|
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
2020-04-16 15:08:22 +02:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS) $(SSLFLAGS)
|
2020-03-31 22:35:56 +02:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) $(TARGET) $(OBJS) $(DEPS)
|
|
|
|
|
|
|
|
-include $(DEPS)
|