Skip to content
Snippets Groups Projects
Makefile 1.05 KiB
Newer Older
  • Learn to ignore specific revisions
  • #
    # Copyright (C) 2022 IOPSYS Software Solutions AB
    #
    # This is free software, licensed under the GNU General Public License v2.
    # See /LICENSE for more information.
    #
    HEADERS := $(shell ls ./*.h)
    SRCS := $(shell ls ./*.c)
    
    
    CFLAGS += -O2 -fcaller-saves -fsection-anchors
    CFLAGS += -Wall -Werror
    
    CFLAGS += -Wextra -std=gnu99
    
    CFLAGS += -DBOS_OS_LINUXUSER -DBOS_CFG_TIME -DNTR_SUPPORT -DWITH_UBUS
    
    CFLAGS += -I./ -Ilibvoice/
    
    ifneq ($(DATAMODEL_UCI_PATH),)
    CFLAGS += -DUCI_CONFIG_DIR=\"$(DATAMODEL_UCI_PATH)\"
    endif
    
    
    OBJS := $(SRCS:.c=.o)
    
    
    LIBS += $(VOICEMNGR_LIBS)
    
    LIBS += -ljson-c -lubox -lubus -lpthread -lpicoevent -luci -L./libvoice -lvoice -lblobmsg_json -lssl -lcrypto
    
    
    %.o: %.c $(HEADERS) Makefile
    
    $(VOICEMNGR): LIBVOICE $(OBJS)
    
    	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
    
    	rm -f *.o $(VOICEMNGR)
    
    
    debug:
    	@echo "HEADERS=$(HEADERS)"
    	@echo "SRCS=$(SRCS)"
    	@echo "OBJS=$(OBJS)"
    	@echo "LIBS=$(LIBS)"
    	@echo "CFLAGS=$(CFLAGS)"
    
    
    .PHONY: debug all clean