Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # ===========================================================================
  2. # libreCMC configuration targets
  3. # These targets are used from top-level makefile
  4. # ===========================================================================
  5. # Shared Makefile for the various kconfig executables:
  6. # conf: Used for defconfig, oldconfig and related targets
  7. # mconf: Used for the mconfig target.
  8. # Utilizes the lxdialog package
  9. # object files used by all kconfig flavours
  10. # Platform specific fixes
  11. #
  12. # FreeBSD
  13. check_lxdialog = $(shell $(SHELL) $(CURDIR)/lxdialog/check-lxdialog.sh -$(1))
  14. export CFLAGS += -DKBUILD_NO_NLS -I. $(call check_lxdialog,ccflags)
  15. conf-objs := conf.o zconf.tab.o
  16. mconf-objs := mconf.o zconf.tab.o
  17. lxdialog-objs := \
  18. lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o \
  19. lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
  20. clean-files := zconf.tab.c lex.zconf.c zconf.hash.c
  21. all: conf mconf
  22. conf: $(conf-objs)
  23. mconf: $(mconf-objs) $(lxdialog-objs)
  24. $(CC) -o $@ $^ $(call check_lxdialog,ldflags $(CC))
  25. clean:
  26. rm -f *.o lxdialog/*.o $(clean-files) conf mconf
  27. zconf.tab.o: zconf.lex.c zconf.hash.c confdata.c
  28. kconfig_load.o: lkc_defs.h
  29. zconf.tab.c: zconf.y
  30. zconf.lex.c: zconf.l
  31. zconf.hash.c: zconf.gperf
  32. %.tab.c: %.y
  33. cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $<
  34. %.lex.c: %.l
  35. cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $<
  36. %.hash.c: %.gperf
  37. cp $@_shipped $@ || gperf < $< > $@