Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. -include ../../../../Rules.make
  2. export PATH=/bin:/sbin:/usr/bin:$(SDK_PATH_TARGET)/usr/bin:$PATH
  3. #define library variable
  4. Internal485ProtocolLib = -L ../../../Modularization/Internal485Protocol -lInternal485Protocol
  5. #PsuCommProtocolLib = -L ../../../Modularization/PsuCommProtocol -lPsuCommProtocol
  6. #define library variable
  7. Lib_Module_RFID = "-L../../../Modularization" -lModule_RFID
  8. Lib_Module_Upgrade = "-L../../../Modularization" -lModule_Upgrade
  9. Lib_SQLite3 = "-L../../../Modularization/ocppfiles" -lsqlite3
  10. all: CopyFile apps
  11. #apps: Module_CSU Module_EvComm Module_EventLogging Module_InternalComm Module_LcmControl Module_PrimaryComm Module_PsuComm
  12. # ReadCmdline kill.sh
  13. apps: MainTask EvCommTask EventLoggingTask InternalCommTask LcmControlTask PrimaryCommTask PsuCommTask ReadCmdlineTask UnsafetyOutputTool FactoryConfigApp OtherTools
  14. MainTask:
  15. rm -f *.o
  16. rm -f main;
  17. $(CC) -D $(Project) -include../../../Modularization/ocppfiles/sqlite3.h -include../../../Modularization/Module_Upgrade.h -include../../../Modularization/Module_RFID.h -O0 -g3 -Wall -c -fmessage-length=0 -o main.o main.c
  18. $(CC) -D $(Project) -include../../../Modularization/ocppfiles/sqlite3.h -include../../../Modularization/Module_Upgrade.h -include../../../Modularization/Module_RFID.h -O0 -g3 -Wall -c -fmessage-length=0 -o timeout.o timeout.c
  19. $(CC) -o main main.o timeout.o ${Lib_Module_RFID} ${Lib_Module_Upgrade} ${Lib_SQLite3}
  20. cp -f main ../Images/root
  21. EvCommTask:
  22. rm -f Module_EvComm;
  23. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Ev_Comm.o Ev_Comm.c
  24. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Module_EvComm.o Module_EvComm.c
  25. $(CC) -o Module_EvComm Ev_Comm.o Module_EvComm.o
  26. cp -f Module_EvComm ../Images/root
  27. EventLoggingTask:
  28. rm -f Module_EventLogging;
  29. $(CC) -D $(Project) -include../../../Modularization/ocppfiles/sqlite3.h -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Module_EventLogging.o Module_EventLogging.c
  30. $(CC) -o Module_EventLogging Module_EventLogging.o ${Lib_SQLite3}
  31. cp -f Module_EventLogging ../Images/root
  32. InternalCommTask:
  33. rm -f Module_InternalComm;
  34. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o internalComm.o internalComm.c
  35. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Module_InternalComm.o Module_InternalComm.c
  36. $(CC) -o Module_InternalComm Module_InternalComm.o internalComm.o
  37. cp -f Module_InternalComm ../Images/root
  38. LcmControlTask:
  39. rm -f Module_LcmControl;
  40. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Module_LcmControl.o Module_LcmControl.c
  41. $(CC) -o Module_LcmControl Module_LcmControl.o
  42. cp -f Module_LcmControl ../Images/root
  43. PrimaryCommTask:
  44. rm -f Module_PrimaryComm;
  45. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Module_PrimaryComm.o Module_PrimaryComm.c
  46. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o PrimaryComm.o PrimaryComm.c
  47. $(CC) -o Module_PrimaryComm Module_PrimaryComm.o PrimaryComm.o
  48. cp -f Module_PrimaryComm ../Images/root
  49. PsuCommTask:
  50. rm -f Module_PsuComm;
  51. $(CC) -D $(Project) -include../../../Modularization/Infypwr_PsuCommObj.h -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o Module_PsuComm.o Module_PsuComm.c
  52. $(CC) -o Module_PsuComm Module_PsuComm.o ../../../Modularization/libInfypwr_PsuCommObj.a
  53. cp -f Module_PsuComm ../Images/root
  54. ReadCmdlineTask:
  55. rm -f ReadCmdline;
  56. $(CC) -D $(Project) -includeConfig.h -O0 -g3 -Wall -c -fmessage-length=0 -o ReadCmdline.o ReadCmdline.c
  57. $(CC) -o ReadCmdline ReadCmdline.o
  58. cp -f ReadCmdline ../Images/root
  59. UnsafetyOutputTool:
  60. rm -f UnsafetyOutputTask;
  61. $(CC) -D $(Project) -include../../../Modularization/Infypwr_PsuCommObj.h -O0 -g3 -Wall -c -fmessage-length=0 -o OutputTask.o OutputTask.c
  62. $(CC) -o UnsafetyOutputTask OutputTask.o ../../../Modularization/libInfypwr_PsuCommObj.a
  63. cp -f UnsafetyOutputTask ../Images/root
  64. FactoryConfigApp:
  65. @echo "===== Module_FactoryConfig_Task =================================="
  66. rm -f FactoryConfig
  67. gcc -D $(Project) "-I../../" -o FactoryConfig "./FactoryConfig.c"
  68. mkdir -p /Storage/SystemLog
  69. ./FactoryConfig -f;true
  70. cp /mnt/FactoryDefaultConfig.bin ../Images
  71. rm -f FactoryConfig;
  72. $(CC) -D $(Project) -O0 -g3 -Wall -c -fmessage-length=0 -o FactoryConfig.o FactoryConfig.c
  73. $(CC) -o FactoryConfig FactoryConfig.o
  74. cp -f FactoryConfig ../Images/root
  75. OtherTools:
  76. cp -f init.sh ../Images/root
  77. cp -f kill.sh ../Images/root
  78. cp -f web.sh ../Images/root
  79. CopyFile:
  80. rm -rfv ../Images/root
  81. mkdir -p ../Images/root