78 lines
2.0 KiB
Makefile
78 lines
2.0 KiB
Makefile
WIZCHIP=W5500
|
|
ENABLE_DHCP=yes
|
|
ENABLE_DNS=yes
|
|
ENABLE_HTTPSERVER=yes
|
|
ENABLE_MQTT=yes
|
|
ENABLE_SNTP=yes
|
|
|
|
# =====================================================================
|
|
|
|
|
|
#arm-none-eabi-gcc -c -mcpu=cortex-m3 -mthumb -DUSE_HAL_DRIVER -DSTM32F103xE
|
|
#-Ihottislib -Ilibmbus -IioLibrary_Driver/Ethernet -IUser/Inc -ICore/Inc
|
|
#-IDrivers/STM32F1xx_HAL_Driver/Inc -IDrivers/STM32F1xx_HAL_Driver/Inc/Legacy
|
|
#-IDrivers/CMSIS/Device/ST/STM32F1xx/Include -IDrivers/CMSIS/Include -IDrivers/CMSIS/Include
|
|
#-Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/logger.d"
|
|
#-Wa,-a,-ad,-alms=build/logger.lst User/Src/logger.c -o build/logger.o
|
|
CFLAGS=-mcpu=cortex-m3 -mthumb -Og -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP
|
|
|
|
CC=arm-none-eabi-gcc
|
|
AR=arm-none-eabi-ar
|
|
|
|
CFLAGS+=-iquote Ethernet -Wall -D_WIZCHIP_=$(WIZCHIP)
|
|
|
|
OBJDIR=build
|
|
VPATH=Ethernet:Ethernet/W5500
|
|
ifeq ($(ENABLE_DHCP),yes)
|
|
VPATH+=Internet/DHCP
|
|
endif
|
|
ifeq ($(ENABLE_DNS),yes)
|
|
VPATH+=Internet/DNS
|
|
endif
|
|
ifeq ($(ENABLE_MQTT),yes)
|
|
VPATH+=Internet/MQTT:Internet/MQTT/MQTTPacket/src
|
|
endif
|
|
ifeq ($(ENABLE_HTTPSERVER),yes)
|
|
VPATH+=Internet/httpServer
|
|
endif
|
|
ifeq ($(ENABLE_SNTP),yes)
|
|
VPATH+=Internet/SNTP
|
|
endif
|
|
|
|
OBJS=$(addprefix $(OBJDIR)/,wizchip_conf.o socket.o w5500.o)
|
|
ifeq ($(ENABLE_DHCP),yes)
|
|
OBJS+=$(addprefix $(OBJDIR)/,dhcp.o)
|
|
endif
|
|
ifeq ($(ENABLE_DNS),yes)
|
|
OBJS+=$(addprefix $(OBJDIR)/,dns.o)
|
|
endif
|
|
ifeq ($(ENABLE_HTTPSERVER),yes)
|
|
OBJS+=$(addprefix $(OBJDIR)/,httpParser.o httpServer.o httpUtil.o)
|
|
endif
|
|
ifeq ($(ENABLE_SNTP),yes)
|
|
OBJS+=$(addprefix $(OBJDIR)/,sntp.o)
|
|
endif
|
|
ifeq ($(ENABLE_MQTT),yes)
|
|
OBJS+=$(addprefix $(OBJDIR)/,MQTTConnectClient.o MQTTConnectServer.o MQTTDeserializePublish.o \
|
|
MQTTFormat.o MQTTPacket.o MQTTSerializePublish.o MQTTSubscribeClient.o MQTTSubscribeServer.o \
|
|
MQTTUnsubscribeClient.o MQTTUnsubscribeServer.o mqtt_interface.o MQTTClient.o)
|
|
endif
|
|
|
|
|
|
|
|
|
|
all: $(OBJS)
|
|
$(AR) rcs w5500.a $^
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
$(OBJS): | $(OBJDIR)
|
|
|
|
$(OBJDIR):
|
|
mkdir $(OBJDIR)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
-rm -rf $(OBJDIR)
|