Makefile 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. -include ../../../../Rules.make
  2. export PATH=/bin:/sbin:/usr/bin:$(SDK_PATH_TARGET)/usr/bin:$PATH
  3. ModularizationPath = ../../../Modularization
  4. RootPath = ../Images/root
  5. OutputPath = ../output
  6. DEFINE = -D $(Project)
  7. CFLAGS = -O0 -g3 -Wall -c -fmessage-length=0
  8. TFLAGS = -lrt -lm -lpthread
  9. #define library variable
  10. Internal485ProtocolLib = -L $(ModularizationPath)/Internal485Protocol -lInternal485Protocol
  11. #PsuCommProtocolLib = -L $(ModularizationPath)/PsuCommProtocol -lPsuCommProtocol
  12. #define library variable
  13. Lib_Module_RFID = "-L$(ModularizationPath)" -lModule_RFID
  14. Lib_Module_Upgrade = "-L$(ModularizationPath)" -lModule_Upgrade
  15. Lib_SQLite3 = "-L$(ModularizationPath)/ocppfiles" -lsqlite3
  16. SQLite3_H = -include$(ModularizationPath)/ocppfiles/sqlite3.h
  17. ModuleUpgrade_H = -include$(ModularizationPath)/Module_Upgrade.h
  18. RFID_H = -include$(ModularizationPath)/Module_RFID.h
  19. InfypwrPsuComm_H = -include$(ModularizationPath)/Infypwr_PsuCommObj.h
  20. InfypwrPsuComm_A = $(ModularizationPath)/libInfypwr_PsuCommObj.a
  21. all: CopyFile apps
  22. #apps: Module_CSU Module_EvComm Module_EventLogging Module_InternalComm Module_LcmControl Module_PrimaryComm Module_PsuComm
  23. # ReadCmdline kill.sh
  24. apps: MainTask DoCommTask EvCommTask \
  25. EventLoggingTask InternalCommTask LcmControlTask \
  26. PrimaryCommTask ReadCmdlineTask UnsafetyOutputTool \
  27. FactoryConfigApp OtherTools CleanExec
  28. LOG_INC = Log
  29. MainTask:
  30. $(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(ModuleUpgrade_H) $(RFID_H) $(CFLAGS) -o main.o ReMain.c
  31. $(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(ModuleUpgrade_H) $(RFID_H) $(CFLAGS) -o timeout.o timeout.c
  32. $(CC) $(TFLAGS) -o main main.o timeout.o ${Lib_Module_RFID} ${Lib_Module_Upgrade} ${Lib_SQLite3}
  33. DoCommTask:
  34. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o DoComm.o ReDoComm.c
  35. $(CC) -o DoComm DoComm.o
  36. EvCommTask:
  37. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o Ev_Comm.o Ev_Comm.c
  38. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o Module_EvComm.o ReModule_EvComm.c
  39. $(CC) -o Module_EvComm Ev_Comm.o Module_EvComm.o
  40. EventLoggingTask:
  41. $(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(CFLAGS) -o Module_EventLogging.o ReModule_EventLogging.c
  42. $(CC) -o Module_EventLogging Module_EventLogging.o ${Lib_SQLite3}
  43. InternalCommTask:
  44. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o internalComm.o internalComm.c
  45. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o Module_InternalComm.o ReModule_InternalComm.c
  46. $(CC) -o Module_InternalComm Module_InternalComm.o internalComm.o
  47. LcmControlTask:
  48. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o Module_LcmControl.o ReModule_LcmControl.c
  49. $(CC) -o Module_LcmControl Module_LcmControl.o
  50. PrimaryCommTask:
  51. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o Module_PrimaryComm.o ReModule_PrimaryComm.c
  52. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o PrimaryComm.o PrimaryComm.c
  53. $(CC) -o Module_PrimaryComm Module_PrimaryComm.o PrimaryComm.o
  54. PsuCommTask:
  55. $(CC) -D $(Project) $(InfypwrPsuComm_H) -includeConfig.h $(CFLAGS) -o Module_PsuComm.o Module_PsuComm.c
  56. $(CC) -o Module_PsuComm Module_PsuComm.o $(InfypwrPsuComm_A)
  57. ReadCmdlineTask:
  58. $(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o ReadCmdline.o ReadCmdline.c
  59. $(CC) -o ReadCmdline ReadCmdline.o
  60. UnsafetyOutputTool:
  61. $(CC) -D $(Project) $(InfypwrPsuComm_H) $(CFLAGS) -o OutputTask.o OutputTask.c
  62. $(CC) -o UnsafetyOutputTask OutputTask.o $(InfypwrPsuComm_A)
  63. FactoryConfigApp:
  64. @echo "===== Module_FactoryConfig_Task =================================="
  65. rm -f FactoryConfig
  66. # gcc -D $(Project) "-I../../" -o FactoryConfig "./FactoryConfig.c"
  67. # mkdir -p /Storage/SystemLog
  68. # ./FactoryConfig -f;true
  69. # cp /mnt/FactoryDefaultConfig.bin ../Images
  70. # rm -f FactoryConfig;
  71. $(CC) -D $(Project) $(CFLAGS) -o FactoryConfig.o FactoryConfig.c
  72. $(CC) -o FactoryConfig FactoryConfig.o
  73. OtherTools:
  74. cp -f init.sh $(RootPath)
  75. cp -f kill.sh $(RootPath)
  76. cp -f web.sh $(RootPath)
  77. cp -f main $(RootPath)
  78. cp -f DoComm $(RootPath)
  79. cp -f Module_EvComm $(RootPath)
  80. cp -f Module_EventLogging $(RootPath)
  81. cp -f Module_InternalComm $(RootPath)
  82. cp -f Module_LcmControl $(RootPath)
  83. cp -f Module_PrimaryComm $(RootPath)
  84. #cp -f Module_PsuComm $(RootPath)
  85. cp -f ReadCmdline $(RootPath)
  86. cp -f UnsafetyOutputTask $(RootPath)
  87. cp -f FactoryConfig $(RootPath)
  88. if [ ! -d $(OutputPath) ]; then mkdir -p $(OutputPath); fi
  89. cp -f init.sh $(OutputPath)
  90. cp -f kill.sh $(OutputPath)
  91. cp -f web.sh $(OutputPath)
  92. cp -f main $(OutputPath)
  93. cp -f DoComm $(OutputPath)
  94. cp -f Module_EvComm $(OutputPath)
  95. cp -f Module_EventLogging $(OutputPath)
  96. cp -f Module_InternalComm $(OutputPath)
  97. cp -f Module_LcmControl $(OutputPath)
  98. cp -f Module_PrimaryComm $(OutputPath)
  99. #cp -f Module_PsuComm $(OutputPath)
  100. cp -f ReadCmdline $(OutputPath)
  101. cp -f UnsafetyOutputTask $(OutputPath)
  102. cp -f FactoryConfig $(OutputPath)
  103. CopyFile:
  104. rm -rfv ../Images/root
  105. mkdir -p ../Images/root
  106. CleanExec:
  107. rm -f *.o
  108. rm main
  109. rm Module_EvComm
  110. rm Module_EventLogging
  111. rm Module_InternalComm
  112. rm Module_LcmControl
  113. rm Module_PrimaryComm
  114. #rm Module_PsuComm
  115. rm ReadCmdline
  116. rm FactoryConfig
  117. rm DoComm