realtek-doc/sources/rtk-xgs1210/build/Makefile.linux.user.rtcore
Markus Stockhausen 18a30ac6d1 add XGS1210 sdk
2025-04-27 15:53:52 -04:00

58 lines
1.1 KiB
Text

#
# Copyright (C) 2009 Realtek Semiconductor Corp.
#
# Makefile for SDK Linux Rtcore User Library
#
TARGET := $(SDK_LIBDIR)/librtcore.a
SDK_TOP_DIR := ../..
SDK_SYS_DIR := ../system
#
# main
#
include $(SDK_TOP_DIR)/sdk/build/Makefile.rtcore
RTCORE_USR_DIR := $(SDK_SYS_DIR)/linux/rtcore/user
RTCORE_USR_OBJ :=
ifeq ($(CONFIG_SDK_DRIVER_NIC_USER_MODE),y)
RTCORE_USR_OBJ += \
$(RTCORE_USR_DIR)/rtcore_drv_usr.o
endif
ALL_OBJ := $(RTCORE_OBJ) $(RTCORE_USR_OBJ)
DEPS := $(ALL_OBJ:.o=.d)
EXTRA_CFLAGS += -Wall -Werror -Wuninitialized -Wstrict-prototypes
EXTRA_CFLAGS += -I$(SDK_INCLUDE) -I$(SYS_INCLUDE) -I$(DRV_INCLUDE) -URTK_UNIVERSAL_BSP
.PHONY: $(TARGET)
$(TARGET): $(ALL_OBJ)
$(AR) rcs $@ $(ALL_OBJ)
$(STRIP) --strip-debug -R .note -R .comment $@
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
%.d: %.c
@set -e; rm -f $@; \
$(CC) -MM $(CFLAGS) $(EXTRA_CFLAGS) $< > $@.$$$$; \
sed 's,\($(*F)\)\.o[ :]*,$(@D)/$(*F).o $@ : ,g' < $@.$$$$ > $@
@rm -f $@.*
NODEP := clean install romfs
ifeq (0, $(words $(findstring $(MAKECMDGOALS), $(NODEP))))
-include $(DEPS)
endif
romfs:
clean:
rm -rf $(TARGET) $(ALL_OBJ) $(DEPS)