mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
arch/sim: Copy include/nuttx/config.h to the local folder
so the source code compiled by host environment can include config.h directly and then avoid pass Kconfig option through Makefile manually Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Ic9fe6f846082cef2d0808dc717df8ae6ed929edf
This commit is contained in:
committed by
Masayuki Ishikawa
parent
3488a98bd7
commit
5e01fe050a
@@ -1,5 +1,6 @@
|
|||||||
/nuttx-names.dat
|
/nuttx-names.dat
|
||||||
/nuttx.ld
|
/nuttx.ld
|
||||||
|
/config.h
|
||||||
/hostfs.h
|
/hostfs.h
|
||||||
/chip
|
/chip
|
||||||
/board
|
/board
|
||||||
|
|||||||
+8
-25
@@ -75,7 +75,6 @@ ifeq ($(CONFIG_HOST_MACOS),y)
|
|||||||
HOSTCFLAGS += -Wno-deprecated-declarations
|
HOSTCFLAGS += -Wno-deprecated-declarations
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HOSTCFLAGS += -DCONFIG_USEC_PER_TICK=$(CONFIG_USEC_PER_TICK)
|
|
||||||
HOSTSRCS = up_hostirq.c up_hostmemory.c up_hosttime.c up_simuart.c
|
HOSTSRCS = up_hostirq.c up_hostmemory.c up_hosttime.c up_simuart.c
|
||||||
STDLIBS += -lpthread
|
STDLIBS += -lpthread
|
||||||
ifeq ($(CONFIG_HOST_MACOS),y)
|
ifeq ($(CONFIG_HOST_MACOS),y)
|
||||||
@@ -97,7 +96,6 @@ endif
|
|||||||
ifeq ($(CONFIG_SMP),y)
|
ifeq ($(CONFIG_SMP),y)
|
||||||
CSRCS += up_smpsignal.c up_cpuidlestack.c
|
CSRCS += up_smpsignal.c up_cpuidlestack.c
|
||||||
REQUIREDOBJS += up_smpsignal$(OBJEXT)
|
REQUIREDOBJS += up_smpsignal$(OBJEXT)
|
||||||
HOSTCFLAGS += -DCONFIG_SMP=1 -DCONFIG_SMP_NCPUS=$(CONFIG_SMP_NCPUS)
|
|
||||||
HOSTSRCS += up_simsmp.c
|
HOSTSRCS += up_simsmp.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -118,22 +116,16 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_SIM_X11FB),y)
|
ifeq ($(CONFIG_SIM_X11FB),y)
|
||||||
ifeq ($(CONFIG_SIM_X11NOSHM),y)
|
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_X11NOSHM=1
|
|
||||||
endif
|
|
||||||
HOSTSRCS += up_x11framebuffer.c
|
HOSTSRCS += up_x11framebuffer.c
|
||||||
STDLIBS += -lX11 -lXext
|
STDLIBS += -lX11 -lXext
|
||||||
ifeq ($(CONFIG_SIM_TOUCHSCREEN),y)
|
ifeq ($(CONFIG_SIM_TOUCHSCREEN),y)
|
||||||
CSRCS += up_touchscreen.c
|
CSRCS += up_touchscreen.c
|
||||||
REQUIREDOBJS += up_touchscreen$(OBJEXT)
|
REQUIREDOBJS += up_touchscreen$(OBJEXT)
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_TOUCHSCREEN=1
|
|
||||||
HOSTSRCS += up_x11eventloop.c
|
HOSTSRCS += up_x11eventloop.c
|
||||||
else ifeq ($(CONFIG_SIM_AJOYSTICK),y)
|
else ifeq ($(CONFIG_SIM_AJOYSTICK),y)
|
||||||
CSRCS += up_ajoystick.c
|
CSRCS += up_ajoystick.c
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_AJOYSTICK=1
|
|
||||||
HOSTSRCS += up_x11eventloop.c
|
HOSTSRCS += up_x11eventloop.c
|
||||||
else ifeq ($(CONFIG_SIM_BUTTONS),y)
|
else ifeq ($(CONFIG_SIM_BUTTONS),y)
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_BUTTONS=1
|
|
||||||
HOSTSRCS += up_x11eventloop.c
|
HOSTSRCS += up_x11eventloop.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -165,23 +157,14 @@ endif
|
|||||||
|
|
||||||
ifeq ($(CONFIG_SIM_NETDEV_TAP),y)
|
ifeq ($(CONFIG_SIM_NETDEV_TAP),y)
|
||||||
CSRCS += up_netdriver.c
|
CSRCS += up_netdriver.c
|
||||||
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_ETH_PKTSIZE)
|
|
||||||
ifneq ($(CONFIG_WINDOWS_CYGWIN),y)
|
ifneq ($(CONFIG_WINDOWS_CYGWIN),y)
|
||||||
HOSTSRCS += up_tapdev.c
|
HOSTSRCS += up_tapdev.c
|
||||||
ifeq ($(CONFIG_SIM_NET_BRIDGE),y)
|
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_NET_BRIDGE
|
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_NET_BRIDGE_DEVICE=\"$(CONFIG_SIM_NET_BRIDGE_DEVICE)\"
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_SIM_NET_HOST_ROUTE),y)
|
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_NET_HOST_ROUTE
|
|
||||||
endif
|
|
||||||
else # CONFIG_WINDOWS_CYGWIN != y
|
else # CONFIG_WINDOWS_CYGWIN != y
|
||||||
HOSTSRCS += up_wpcap.c
|
HOSTSRCS += up_wpcap.c
|
||||||
STDLIBS = /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a
|
STDLIBS = /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a
|
||||||
endif # CONFIG_WINDOWS_CYGWIN != y
|
endif # CONFIG_WINDOWS_CYGWIN != y
|
||||||
else ifeq ($(CONFIG_SIM_NETDEV_VPNKIT),y)
|
else ifeq ($(CONFIG_SIM_NETDEV_VPNKIT),y)
|
||||||
CSRCS += up_netdriver.c
|
CSRCS += up_netdriver.c
|
||||||
HOSTCFLAGS += -DCONFIG_SIM_NETDEV_VPNKIT_PATH=\"$(CONFIG_SIM_NETDEV_VPNKIT_PATH)\"
|
|
||||||
HOSTSRCS += up_vpnkit.c
|
HOSTSRCS += up_vpnkit.c
|
||||||
VPATH += :sim/vpnkit
|
VPATH += :sim/vpnkit
|
||||||
HOSTSRCS += protocol.c negotiate.c
|
HOSTSRCS += protocol.c negotiate.c
|
||||||
@@ -192,10 +175,6 @@ ifeq ($(CONFIG_SIM_HCISOCKET),y)
|
|||||||
CSRCS += up_hcisocket.c
|
CSRCS += up_hcisocket.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_I2C_RESET),y)
|
|
||||||
HOSTCFLAGS += -DCONFIG_I2C_RESET=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_SIM_I2CBUS_LINUX),y)
|
ifeq ($(CONFIG_SIM_I2CBUS_LINUX),y)
|
||||||
HOSTSRCS += up_i2cbuslinux.c
|
HOSTSRCS += up_i2cbuslinux.c
|
||||||
endif
|
endif
|
||||||
@@ -212,13 +191,12 @@ endif
|
|||||||
ifeq ($(CONFIG_FS_HOSTFS),y)
|
ifeq ($(CONFIG_FS_HOSTFS),y)
|
||||||
ifneq ($(CONFIG_FS_HOSTFS_RPMSG),y)
|
ifneq ($(CONFIG_FS_HOSTFS_RPMSG),y)
|
||||||
HOSTSRCS += up_hostfs.c
|
HOSTSRCS += up_hostfs.c
|
||||||
HOSTCFLAGS += -DCONFIG_NAME_MAX=$(CONFIG_NAME_MAX)
|
|
||||||
|
|
||||||
up_hostfs.c: hostfs.h
|
|
||||||
|
|
||||||
hostfs.h: $(TOPDIR)/include/nuttx/fs/hostfs.h
|
hostfs.h: $(TOPDIR)/include/nuttx/fs/hostfs.h
|
||||||
@echo "CP: $<"
|
@echo "CP: $<"
|
||||||
$(Q) cp $< $@
|
$(Q) cp $< $@
|
||||||
|
|
||||||
|
up_hostfs.c: hostfs.h
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -325,7 +303,11 @@ makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(HOSTSRCS:.c=.ddh)
|
|||||||
$(call CATFILE, Make.dep, $^)
|
$(call CATFILE, Make.dep, $^)
|
||||||
$(call DELFILE, $^)
|
$(call DELFILE, $^)
|
||||||
|
|
||||||
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
|
config.h: $(TOPDIR)/include/nuttx/config.h
|
||||||
|
@echo "CP: $<"
|
||||||
|
$(Q) cp $< $@
|
||||||
|
|
||||||
|
.depend: Makefile config.h $(SRCS) $(TOPDIR)$(DELIM).config
|
||||||
$(Q) if [ -e board/Makefile ]; then \
|
$(Q) if [ -e board/Makefile ]; then \
|
||||||
$(MAKE) -C board depend ; \
|
$(MAKE) -C board depend ; \
|
||||||
fi
|
fi
|
||||||
@@ -352,6 +334,7 @@ distclean:: clean
|
|||||||
fi
|
fi
|
||||||
$(call DELFILE, Make.dep)
|
$(call DELFILE, Make.dep)
|
||||||
$(call DELFILE, .depend)
|
$(call DELFILE, .depend)
|
||||||
|
$(call DELFILE, config.h)
|
||||||
$(call DELFILE, hostfs.h)
|
$(call DELFILE, hostfs.h)
|
||||||
|
|
||||||
-include Make.dep
|
-include Make.dep
|
||||||
|
|||||||
@@ -40,10 +40,7 @@
|
|||||||
#include <nuttx/net/bluetooth.h>
|
#include <nuttx/net/bluetooth.h>
|
||||||
#include <nuttx/wireless/bluetooth/bt_driver.h>
|
#include <nuttx/wireless/bluetooth/bt_driver.h>
|
||||||
#include <nuttx/wireless/bluetooth/bt_uart.h>
|
#include <nuttx/wireless/bluetooth/bt_uart.h>
|
||||||
|
#include <nuttx/serial/uart_bth4.h>
|
||||||
#if defined(CONFIG_UART_BTH4)
|
|
||||||
#include <nuttx/serial/uart_bth4.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
#include "up_hcisocket_host.h"
|
#include "up_hcisocket_host.h"
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#define __SIM__ 1
|
|
||||||
#include "hostfs.h"
|
#include "hostfs.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __SIM__
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -25,9 +25,11 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __SIM__
|
||||||
# include <nuttx/config.h>
|
#include "config.h"
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <stdbool.h>
|
# include <stdbool.h>
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
@@ -89,6 +91,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct tcb_s;
|
struct tcb_s;
|
||||||
|
struct foc_dev_s;
|
||||||
struct spi_dev_s;
|
struct spi_dev_s;
|
||||||
struct qspi_dev_s;
|
struct qspi_dev_s;
|
||||||
struct ioexpander_dev_s;
|
struct ioexpander_dev_s;
|
||||||
@@ -353,8 +356,7 @@ void up_stack_color(void *stackbase, size_t nbytes);
|
|||||||
/* up_foc.c *****************************************************************/
|
/* up_foc.c *****************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_MOTOR_FOC
|
#ifdef CONFIG_MOTOR_FOC
|
||||||
struct foc_dev_s;
|
struct foc_dev_s *sim_foc_initialize(int inst);
|
||||||
FAR struct foc_dev_s *sim_foc_initialize(int inst);
|
|
||||||
void sim_foc_update(void);
|
void sim_foc_update(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -53,10 +53,7 @@
|
|||||||
#include <nuttx/net/net.h>
|
#include <nuttx/net/net.h>
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
#include <nuttx/net/arp.h>
|
#include <nuttx/net/arp.h>
|
||||||
|
#include <nuttx/net/pkt.h>
|
||||||
#ifdef CONFIG_NET_PKT
|
|
||||||
# include <nuttx/net/pkt.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
|
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -154,7 +156,7 @@ int simuart_getc(int fd)
|
|||||||
* Name: simuart_getcflag
|
* Name: simuart_getcflag
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int simuart_getcflag(int fd, tcflag_t *cflag)
|
int simuart_getcflag(int fd, unsigned int *cflag)
|
||||||
{
|
{
|
||||||
struct termios t;
|
struct termios t;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -176,7 +178,7 @@ int simuart_getcflag(int fd, tcflag_t *cflag)
|
|||||||
* Name: simuart_setcflag
|
* Name: simuart_setcflag
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int simuart_setcflag(int fd, tcflag_t cflag)
|
int simuart_setcflag(int fd, unsigned int cflag)
|
||||||
{
|
{
|
||||||
struct termios t;
|
struct termios t;
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -56,11 +56,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <net/route.h>
|
||||||
#ifdef CONFIG_SIM_NET_HOST_ROUTE
|
|
||||||
# include <net/route.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
#include <linux/if_tun.h>
|
#include <linux/if_tun.h>
|
||||||
|
|||||||
@@ -23,10 +23,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdatomic.h>
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#include "up_internal.h"
|
||||||
# include <stdatomic.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
|
|||||||
@@ -54,6 +54,8 @@
|
|||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -174,7 +176,8 @@ static void init_pcap(struct in_addr addr)
|
|||||||
error_exit("No interface found with IP address");
|
error_exit("No interface found with IP address");
|
||||||
}
|
}
|
||||||
|
|
||||||
pcap = pcap_open_live(interfaces->name, NETDEV_BUFSIZE, 0, -1, error);
|
pcap = pcap_open_live(interfaces->name,
|
||||||
|
CONFIG_NET_ETH_PKTSIZE, 0, -1, error);
|
||||||
if (pcap == NULL)
|
if (pcap == NULL)
|
||||||
{
|
{
|
||||||
error_exit(error);
|
error_exit(error);
|
||||||
|
|||||||
@@ -29,11 +29,10 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
|
#include <sys/shm.h>
|
||||||
|
#include <X11/extensions/XShm.h>
|
||||||
|
|
||||||
#ifndef CONFIG_SIM_X11NOSHM
|
#include "up_internal.h"
|
||||||
# include <sys/shm.h>
|
|
||||||
# include <X11/extensions/XShm.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
|
|||||||
@@ -198,6 +198,6 @@ ifeq ($(CONFIG_SIM_SANITIZE),y)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||||
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(EXTRAFLAGS) -pipe
|
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(EXTRAFLAGS) -D__SIM__ -pipe
|
||||||
|
|
||||||
LDLINKFLAGS += -nostartfiles -nodefaultlibs
|
LDLINKFLAGS += -nostartfiles -nodefaultlibs
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
#else
|
#else
|
||||||
|
# include <config.h>
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user