Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. VCC_MAJOR = 1
  2. VCC_MINOR = 41
  3. VCC_PATCH = 2
  4. VCC_STR = -rc
  5. # change this to '/usr/share/' or '/opt/vcc/' etc
  6. INSTALL = $(shell pwd)
  7. MO_DIR = $(INSTALL)/lang/zh_CN/LC_MESSAGES
  8. VCC_COMPILE_TIME = $(shell date)
  9. VCC_COMPILE_BY = $(shell whoami)
  10. VCC_SEMVER = vcc $(VCC_MAJOR).$(VCC_MINOR).$(VCC_PATCH)$(VCC_STR)
  11. VCC_SEMVER_NS = vcc-$(VCC_MAJOR).$(VCC_MINOR).$(VCC_PATCH)$(VCC_STR)
  12. macro_srcs = gnr_theme_macros.m4 gnr_load_themes.m4
  13. macro_objs = gnr_theme_macros.s gnr_load_themes.s
  14. srcs = main.c vcc.c pretty.c cmd.c crypt.c klist.c plugins.c robot.c intiauth.c hooks.c
  15. objs = main.o vcc.o pretty.o cmd.o crypt.o klist.o plugins.o robot.o intiauth.o hooks.o
  16. target = vcc
  17. libgcrypt_cflags = $(shell libgcrypt-config --libs)
  18. CFLAGS = -std=gnu11 -Wall -Wextra -Werror -Iinclude -g $(libgcrypt_cflags) -Lplugins -lplugins \
  19. -Llibs -lreadconf -Ilibs/readconf/include
  20. MAKEFLAGS = --no-print-directory
  21. VCC_DEFSERV = 39.104.27.216
  22. VCC_VERSION = vcc $(VCC_MAJOR).$(VCC_MINOR).$(VCC_PATCH) \
  23. $(VCC_COMPILE_TIME) $(VCC_COMPILE_BY)
  24. all : macros
  25. @echo "$(VCC_VERSION)"
  26. @echo "$(VCC_SEMVER)"
  27. @echo "#define VCC_VERSION \"$(VCC_VERSION)\"" > include/vcc/version.h
  28. @echo "#define VCC_SEMVER \"$(VCC_SEMVER)\"" >> include/vcc/version.h
  29. @echo "#define VCC_DEFSERV \"$(VCC_DEFSERV)\"" > include/vcc/defserv.h
  30. @echo "#define INSTALL_PATH \"$(INSTALL)\"" > include/vcc/config.h
  31. @$(MAKE) -C libs/
  32. @$(MAKE) -C plugins/
  33. @$(MAKE) $(target) $(MAKEFLAGS)
  34. @$(MAKE) mo
  35. macros : $(macro_srcs) $(macro_objs)
  36. %.s : %.m4
  37. @m4 $*.m4 > $*.s
  38. @echo -e "M4\t\t\t$*.m4"
  39. mo :
  40. @mkdir -p $(MO_DIR)
  41. @msgfmt --check --verbose --output-file $(MO_DIR)/vcc.mo po/zh_CN.po
  42. $(target) : $(objs) $(srcs)
  43. @$(CC) $(objs) $(CFLAGS) -o $(target)
  44. @echo -e "LD\t\t\t$(target)"
  45. %.o : %.c
  46. @$(CC) -c $(CFLAGS) $*.c
  47. @echo -e "CC\t\t\t$*.c"
  48. backup : clean
  49. (dir=$$(basename `pwd`); cd ..; tar cf $(VCC_SEMVER_NS).tar.gz $$dir/*)
  50. .PHONY : clean
  51. clean :
  52. $(RM) $(objs) $(target) $(macro_objs) -f
  53. $(RM) -rf lang
  54. @$(MAKE) -C libs/ clean
  55. @$(MAKE) -C plugins/ clean