Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
  4. #
  5. # This program is free software; you can redistribute it and/or modify it under
  6. # the terms of the GNU Library General Public License as published by the Free
  7. # Software Foundation; either version 2 of the License, or (at your option) any
  8. # later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but WITHOUT
  11. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Library General Public License
  16. # along with this program; if not, write to the Free Software Foundation, Inc.,
  17. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. TOPDIR=../../
  19. include $(TOPDIR)Rules.mak
  20. all: conf mconf
  21. NATIVE_CFLAGS=-Wall -g -O0
  22. CONF_SRC =conf.c zconf.tab.c
  23. MCONF_SRC =mconf.c zconf.tab.c
  24. CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
  25. MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
  26. conf: $(CONF_OBJS)
  27. $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@
  28. mconf: $(MCONF_OBJS)
  29. $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@
  30. lkc_deps:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
  31. conf.o: conf.c $(lkc_deps)
  32. mconf.o: mconf.c $(lkc_deps)
  33. zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(lkc_deps)
  34. lex.zconf.o: lex.zconf.c $(lkc_deps)
  35. %.o : %.c
  36. $(NATIVE_CC) $(NATIVE_CFLAGS) -I. -c $< -o $@
  37. lkc_defs.h: lkc_proto.h
  38. @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
  39. ###
  40. # The following requires flex/bison
  41. # By default we use the _shipped versions, uncomment the
  42. # following line if you are modifying the flex/bison src.
  43. #LKC_GENPARSER := 1
  44. ifdef LKC_GENPARSER
  45. %.tab.c %.tab.h: %.y
  46. bison -t -d -v -b $* -p $(notdir $*) $<
  47. lex.%.c: %.l
  48. flex -P$(notdir $*) -o$@ $<
  49. else
  50. lex.zconf.c: lex.zconf.c_shipped
  51. cp lex.zconf.c_shipped lex.zconf.c
  52. zconf.tab.c: zconf.tab.c_shipped
  53. cp zconf.tab.c_shipped zconf.tab.c
  54. zconf.tab.h: zconf.tab.h_shipped
  55. cp zconf.tab.h_shipped zconf.tab.h
  56. endif
  57. clean:
  58. rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \
  59. conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h