Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ### Application-specific constants
  2. APP_NAME = apps
  3. ### Environment constants
  4. #ARCH := arm
  5. #CROSS_COMPILE := ../../buildroot-at91-2018.02-at91/output/host/bin/arm-linux-
  6. #CROSS_COMPILE := /home/logan/EmbeddedProject/RTU/buildroot/buildroot-at91-2018.02-at91/output/host/bin/arm-linux-
  7. #CROSS_COMPILE := /home/logan/iot/EdgeGateway/a40_src/out/sun8iw11p1/linux/common/buildroot/host/opt/ext-toolchain/bin/arm-linux-gnueabi-
  8. OBJDIR = obj
  9. INCLUDES = $(wildcard inc/*.h)
  10. ### External constant definitions
  11. # must get library build option to know if mpsse must be linked or not
  12. ### Constant symbols
  13. CC := $(CROSS_COMPILE)gcc
  14. AR := $(CROSS_COMPILE)ar
  15. #CC := gcc
  16. #AR := ar
  17. CFLAGS := -O2 -Wall -Wextra -Iinc -I.
  18. ##CFLAGS := -O2 -Wall -Wextra -I.
  19. # List the library sub-modules that are used by the application
  20. ### Linking options
  21. #LIBS := -lmosquitto -lcrypto -lsqlite3 -ljson-c -lrt -lpthread -lm
  22. #LIBS := -lmosquitto -lcrypto -lsqlite3 -ljson-c -lrt -lpthread -lm -Wl,-rpath=../../buildroot-at91-2018.02-at91/output/target/usr/lib
  23. LIBS := -lmosquitto -lsqlite3 -ljson-c -lrt -lpthread -lm
  24. ### General build targets
  25. all: $(APP_NAME)
  26. clean:
  27. rm -f *.o
  28. rm -f $(APP_NAME)
  29. ### Sub-modules compilation
  30. %.o: %.c
  31. $(CC) $(CFLAGS) -c $< -o $@
  32. $(APP_NAME):apps.o sql_api.o common.o
  33. $(CC) $^ -o $@ $(LIBS)
  34. #sql_api: command.o sql_api.o common.o
  35. # $(CC) $^ -o $@ $(LIBS)
  36. install:
  37. echo "install"
  38. ### EOF