123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- #topee imx6ull
- #CC=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
- #mrzy
- #CC=/usr/local/arm/fsl-imx-x11/4.1.15-2.1.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-
- #mc am335x
- #CC=/usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin/arm-linux-gnueabihf-
- # --sysroot=/home/cyx/LLVMEmbeddedToolchainForArm-17.0.0-Linux-x86_64/lib/clang-runtimes/arm-none-eabi/armv7a_hard_vfpv3_d16 \
- # CC=clang \
- # --target=arm-linux-gnueabihf \
- # -mcpu=cortex-a7 \
- # -mfpu=neon \
- # -fno-exceptions \
- # -fno-rtti \
- # -lcrt0-semihost \
- # -lsemihost \
- # -T picolibc.ld \
- # CC=clang \
- # --target=armv7-linux-gnueabihf \
- # -mfpu=none \
- # -mfpu=neon \
- # -fno-exceptions \
- # -fno-rtti \
- # ifeq (, $(shell which clang-17))
- CC=arm-linux-gnueabihf-gcc
- # $(info "use gcc for default")
- # else
- # CC=clang-17 \
- # -Xclang -fix-only-warnings \
- # -mcpu=cortex-a7 \
- # -mfpu=neon \
- # -mfloat-abi=hard \
- # --target=armv7l-linux-gnueabihf \
- # --sysroot=/usr/arm-linux-gnueabihf/ \
- # -fuse-ld=lld \
- # -stdlib=libc++
- # $(info "we got clang 17")
- # endif
- # -rtlib=compiler-rt
- #
- # CFLAGS=-flto -w -Wfatal-errors -Wall -Wextra -Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-parameter -Wno-unused-variable -Werror=format -Werror=incompatible-pointer-types
- # CFLAGS=-flto -Wfatal-errors -Wall -Wextra -Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-comment -Werror=format -Werror=incompatible-pointer-types
- # CFLAGS=-flto -Wfatal-errors -Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-comment -Werror=format -Werror=incompatible-pointer-types -Werror=implicit-int -Werror=lto-type-mismatch -Werror=return-type -Werror=conversion
- # CFLAGS=-Wfatal-errors -Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-comment -Werror=format -Werror=incompatible-pointer-types -Werror=implicit-int
- CFLAGS=-funwind-tables -flto -Wfatal-errors -Wno-implicit-function-declaration -Wno-int-conversion -Wno-unused-const-variable -Wno-unused-parameter -Wno-unused-variable -Wno-comment -Werror=format -Werror=incompatible-pointer-types -Werror=implicit-int
- SRCFILES = appl/main.c \
- appl/appl.c \
- appl/cloud/cloud.c \
- appl/tb/tb.c \
- appl/ems/ems_sm.c \
- appl/ems/ems.c \
- appl/ems/timeseg.c \
- appl/ems/estats.c \
- appl/ems/pcurv.c \
- appl/ems/schedule.c \
- appl/ems/pgrid.c \
- platform/abs/plt.c\
- platform/abs/ctn.c\
- platform/abs/ess.c\
- platform/abs/meter.c\
- platform/abs/transformers.c\
- platform/util/misc/misc.c\
- platform/util/log/log.c\
- platform/util/tool/tool.c\
- platform/util/shm/shm.c\
- platform/util/mqtt/mqtt_sm.c\
- platform/util/mqtt/mqtt.c\
- platform/util/mqtt/mqtt_ringbuffer.c\
- platform/util/mqtt/mqtt_cache.c\
- platform/util/tbmqtt/tbmqtt_sm.c\
- platform/util/tbmqtt/tbmqtt.c\
- platform/util/tbmqtt/tbmqtt_ringbuffer.c\
- platform/util/tbmqtt/tbmqtt_cache.c\
- platform/util/comm/comm.c\
- platform/util/statemachine/sm.c\
- platform/device/chan/chan.c\
- platform/device/chan/chan_serial_ringbuffer.c\
- platform/device/chan/chan_socketcan_ringbuffer.c\
- platform/device/chan/chan_tcpservcan_ringbuffer.c\
- platform/device/chan/mbs.c\
- platform/device/ctn/zh200_comm.c\
- platform/device/ctn/zh200_sm.c\
- platform/device/ctn/zh200.c\
- platform/device/meter/abb_b23_4_comm.c\
- platform/device/meter/abb_b23_4_sm.c\
- platform/device/meter/abb_b23_4.c\
- platform/device/meter/dtsd1352_comm.c\
- platform/device/meter/dtsd1352_sm.c\
- platform/device/meter/dtsd1352.c\
- platform/device/meter/dlt645_comm.c\
- platform/device/meter/dlt645_sm.c\
- platform/device/meter/dlt645.c\
- platform/device/meter/dlt645_api_07.c\
- platform/device/meter/adl200_comm.c\
- platform/device/meter/adl200_sm.c\
- platform/device/meter/adl200.c\
- platform/device/mac/mac.c\
- appl/sta/sta_sm.c\
- appl/sta/sta.c
- COMPONENTS = component/freemodbus/modbus/ascii/mbascii.c \
- component/freemodbus/modbus/functions/mbfunccoils.c \
- component/freemodbus/modbus/functions/mbfuncdiag.c \
- component/freemodbus/modbus/functions/mbfuncdisc.c \
- component/freemodbus/modbus/functions/mbfuncholding.c \
- component/freemodbus/modbus/functions/mbfuncinput.c \
- component/freemodbus/modbus/functions/mbfuncother.c \
- component/freemodbus/modbus/functions/mbutils.c \
- component/freemodbus/modbus/rtu/mbcrc.c \
- component/freemodbus/modbus/rtu/mbrtu.c \
- component/freemodbus/modbus/tcp/mbtcp.c \
- component/freemodbus/modbus/mb.c \
- component/freemodbus/port/portevent.c \
- component/freemodbus/port/portother.c \
- component/freemodbus/port/portserial.c \
- component/freemodbus/port/porttcp.c \
- component/freemodbus/port/porttimer.c \
- component/libmodbus/src/modbus.c \
- component/libmodbus/src/modbus-data.c \
- component/libmodbus/src/modbus-rtu.c \
- component/libmodbus/src/modbus-tcp.c \
- component/sqlite/sqlite3.c \
- component/zlog/buf.c \
- component/zlog/category.c \
- component/zlog/category_table.c \
- component/zlog/conf.c \
- component/zlog/event.c \
- component/zlog/format.c \
- component/zlog/level.c \
- component/zlog/level_list.c \
- component/zlog/mdc.c \
- component/zlog/record.c \
- component/zlog/record_table.c \
- component/zlog/rotater.c \
- component/zlog/rule.c \
- component/zlog/spec.c \
- component/zlog/thread.c \
- component/zlog/zc_arraylist.c \
- component/zlog/zc_hashtable.c \
- component/zlog/zc_profile.c \
- component/zlog/zc_util.c \
- component/zlog/zlog.c \
- component/cJSON/cJSON.c \
- component/paho.mqtt.c-1.3.9/src/Base64.c \
- component/paho.mqtt.c-1.3.9/src/Clients.c \
- component/paho.mqtt.c-1.3.9/src/Heap.c \
- component/paho.mqtt.c-1.3.9/src/LinkedList.c \
- component/paho.mqtt.c-1.3.9/src/Log.c \
- component/paho.mqtt.c-1.3.9/src/Messages.c \
- component/paho.mqtt.c-1.3.9/src/MQTTClient.c \
- component/paho.mqtt.c-1.3.9/src/MQTTPacket.c \
- component/paho.mqtt.c-1.3.9/src/MQTTPacketOut.c \
- component/paho.mqtt.c-1.3.9/src/MQTTPersistence.c \
- component/paho.mqtt.c-1.3.9/src/MQTTPersistenceDefault.c \
- component/paho.mqtt.c-1.3.9/src/MQTTProperties.c \
- component/paho.mqtt.c-1.3.9/src/MQTTProtocolClient.c \
- component/paho.mqtt.c-1.3.9/src/MQTTProtocolOut.c \
- component/paho.mqtt.c-1.3.9/src/MQTTReasonCodes.c \
- component/paho.mqtt.c-1.3.9/src/MQTTTime.c \
- component/paho.mqtt.c-1.3.9/src/OsWrapper.c \
- component/paho.mqtt.c-1.3.9/src/SHA1.c \
- component/paho.mqtt.c-1.3.9/src/Socket.c \
- component/paho.mqtt.c-1.3.9/src/SocketBuffer.c \
- component/paho.mqtt.c-1.3.9/src/SSLSocket.c \
- component/paho.mqtt.c-1.3.9/src/StackTrace.c \
- component/paho.mqtt.c-1.3.9/src/Thread.c \
- component/paho.mqtt.c-1.3.9/src/Tree.c \
- component/paho.mqtt.c-1.3.9/src/utf-8.c \
- component/paho.mqtt.c-1.3.9/src/WebSocket.c\
- component/snowid/snowid.c \
- component/snowid/snowid_util.c \
- component/snowid/snowid_checkpoint.c \
- component/uuid4/src/uuid4.c
- SRC = $(shell find platform/ -name "*.c") $(shell find appl/ -name "*.c") $(COMPONENTS)
- INCLUDES = $(addprefix -I,$(shell find appl/ -type d -print)) $(addprefix -I,$(shell find platform/ -type d -print)) $(addprefix -I,$(shell find component/ -type d -print))
- all:
- mkdir -p bin
- $(CC) $(CFLAGS) $(SRCFILES) $(COMPONENTS) $(INCLUDES) -lpthread -lm -lrt -ldl -ggdb3 -o bin/stad
- debug:
- mkdir -p bin
- $(CC) $(CFLAGS) $(SRCFILES) $(COMPONENTS) $(INCLUDES) -rdynamic -DDEBUG -lpthread -lm -lrt -ldl -w -ggdb3 -o bin/stad
- backtrace:
- mkdir -p bin
- $(CC) $(CFLAGS) $(SRCFILES) $(COMPONENTS) $(INCLUDES) -rdynamic -funwind-tables -DBACKTRACE -lpthread -lm -lrt -ldl -w -ggdb3 -o bin/stad
- backtrace-test:
- mkdir -p bin
- $(CC) $(CFLAGS) backtrace-test.c -lpthread -lm -lrt -ldl -w -ggdb3 -o bin/backtrace-test
- clean:
- rm -rf ./bin/*
- # tidy:
- # clang-tidy-17 -checks= --warnings-as-errors= --fix-errors appl/ems/ems.c -- $(INCLUDES)
|