Support GNU/Linux target.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 1 Aug 2017 08:34:28 +0000 (17:34 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 1 Aug 2017 08:34:28 +0000 (17:34 +0900)
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
ChangeLog
chopstx
fraucheky
src/Makefile.in
src/configure

index 06425ff..6a55f8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-08-01  NIIBE Yutaka  <gniibe@fsij.org>
 
 2017-08-01  NIIBE Yutaka  <gniibe@fsij.org>
 
+       * src/Makefile.in: Support GNU/Linux target.
+       * src/configure: Support GNU/Linux target.
+
+2017-08-01  NIIBE Yutaka  <gniibe@fsij.org>
+
        * src/configure: Support build without git.
 
 2016-10-17  NIIBE Yutaka  <gniibe@fsij.org>
        * src/configure: Support build without git.
 
 2016-10-17  NIIBE Yutaka  <gniibe@fsij.org>
diff --git a/chopstx b/chopstx
index d448d3c..87767f1 160000 (submodule)
--- a/chopstx
+++ b/chopstx
@@ -1 +1 @@
-Subproject commit d448d3c678245b71a28b44652c053968ea70fa56
+Subproject commit 87767f1be5d8d4adac8d23a285250299eccee3fb
index c37df03..2b2907a 160000 (submodule)
--- a/fraucheky
+++ b/fraucheky
@@ -1 +1 @@
-Subproject commit c37df03b7de1f43ea7d9dd1c4e54f1a4e3c39b5d
+Subproject commit 2b2907af4cdf91954fee48ce8ba7d0d931f77915
index 3745cd3..dc7d4a3 100644 (file)
@@ -7,30 +7,31 @@ CHOPSTX = ../chopstx
 FRAUCHEKY = ../fraucheky
 
 # Define linker script file here
 FRAUCHEKY = ../fraucheky
 
 # Define linker script file here
-LDSCRIPT= neug.ld
+LDSCRIPT= @LDSCRIPT@
 
 CSRC = main.c sha256.c neug.c
 
 CSRC = main.c sha256.c neug.c
-CHIP=stm32f103
-USE_SYS = yes
+CHIP=@CHIP@
+USE_SYS = @USE_SYS@
 USE_USB = yes
 USE_ADC = yes
 USE_USB = yes
 USE_ADC = yes
+EMULATION=@EMULATION@
 
 @ENABLE_FRAUCHEKY@include $(FRAUCHEKY)/src.mk
 
 @HEXOUTPUT_MAKE_OPTION@
 
 ###################################
 
 @ENABLE_FRAUCHEKY@include $(FRAUCHEKY)/src.mk
 
 @HEXOUTPUT_MAKE_OPTION@
 
 ###################################
-CROSS = arm-none-eabi-
+CROSS = @CROSS@
 CC   = $(CROSS)gcc
 LD   = $(CROSS)gcc
 OBJCOPY   = $(CROSS)objcopy
 
 CC   = $(CROSS)gcc
 LD   = $(CROSS)gcc
 OBJCOPY   = $(CROSS)objcopy
 
-MCU   = cortex-m3
+MCU   = @MCU@
 CWARN = -Wall -Wextra -Wstrict-prototypes
 # DEFS: Add  
 CWARN = -Wall -Wextra -Wstrict-prototypes
 # DEFS: Add  
-DEFS  = @USE_SYS3@
+DEFS  = @USE_SYS3@ @DEF_EMULATION@
 OPT   = -O3 -Os -g
 OPT   = -O3 -Os -g
-LIBS  =
+LIBS  = @LIBS@
 
 #######################
 include $(CHOPSTX)/rules.mk
 
 #######################
 include $(CHOPSTX)/rules.mk
@@ -42,8 +43,6 @@ board.h:
        @echo Please run configure to have a symbolic link \'board.h\'
        @exit 1
 
        @echo Please run configure to have a symbolic link \'board.h\'
        @exit 1
 
-sys.c: board.h
-
 build/sha256.o: OPT = -O3 -g
 build/neug.o: OPT = -O3 -g
 
 build/sha256.o: OPT = -O3 -g
 build/neug.o: OPT = -O3 -g
 
index a3061ae..fa5fd0b 100755 (executable)
@@ -195,6 +195,26 @@ STM8S_DISCOVERY)
   ;;
 esac
 
   ;;
 esac
 
+if test "$target" = "GNU_LINUX"; then
+  ldscript=""
+  chip="gnu-linux"
+  use_sys=""
+  emulation="yes"
+  cross=""
+  mcu="none"
+  def_emulation="-DGNU_LINUX_EMULATION"
+  libs="-lpthread"
+else
+  ldscript="neug.ld"
+  chip="stm32f103"
+  use_sys="yes"
+  emulation=""
+  cross="arm-none-eabi-"
+  mcu="cortex-m3"
+  def_emulation=""
+  libs=""
+fi
+
 # --with-dfu option
 if test "$with_dfu" = "yes"; then
   if test "$target" = "FST_01" -o "$target" = "FST_01_00"; then
 # --with-dfu option
 if test "$with_dfu" = "yes"; then
   if test "$target" = "FST_01" -o "$target" = "FST_01_00"; then
@@ -312,7 +332,15 @@ else
 fi
 
 
 fi
 
 
-sed -e "s%@USE_SYS3@%$use_sys3%" \
+sed -e "s%@LDSCRIPT@%$ldscript%" \
+    -e "s%@CHIP@%$chip%" \
+    -e "s%@USE_SYS@%$use_sys%" \
+    -e "s%@EMULATION@%$emulation%" \
+    -e "s%@CROSS@%$cross%" \
+    -e "s%@MCU@%$mcu%" \
+    -e "s%@DEF_EMULATION@%$def_emulation%" \
+    -e "s%@LIBS@%$libs%" \
+    -e "s%@USE_SYS3@%$use_sys3%" \
     -e "s%@ENABLE_FRAUCHEKY@%$ENABLE_FRAUCHEKY%" \
     -e "s%@HEXOUTPUT_MAKE_OPTION@%$HEXOUTPUT_MAKE_OPTION%" \
        < Makefile.in > Makefile
     -e "s%@ENABLE_FRAUCHEKY@%$ENABLE_FRAUCHEKY%" \
     -e "s%@HEXOUTPUT_MAKE_OPTION@%$HEXOUTPUT_MAKE_OPTION%" \
        < Makefile.in > Makefile