3 # Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
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
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
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
20 include $(TOPDIR)Rules.mak
25 NATIVE_CFLAGS=-Wall -g -O0
28 CONF_SRC =conf.c zconf.tab.c
29 MCONF_SRC =mconf.c zconf.tab.c
30 CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
31 MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
34 $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@
37 $(NATIVE_CC) $(NATIVE_CFLAGS) $(NATIVE_LDFLAGS) $^ -o $@
39 lkc_deps:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
41 conf.o: conf.c $(lkc_deps)
43 mconf.o: mconf.c $(lkc_deps)
45 zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(lkc_deps)
47 lex.zconf.o: lex.zconf.c $(lkc_deps)
50 $(NATIVE_CC) $(NATIVE_CFLAGS) -I. -c $< -o $@
52 lkc_defs.h: lkc_proto.h
53 @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
56 # The following requires flex/bison
57 # By default we use the _shipped versions, uncomment the
58 # following line if you are modifying the flex/bison src.
64 bison -t -d -v -b $* -p $(notdir $*) $<
67 flex -P$(notdir $*) -o$@ $<
70 lex.zconf.c: lex.zconf.c_shipped
71 cp lex.zconf.c_shipped lex.zconf.c
73 zconf.tab.c: zconf.tab.c_shipped
74 cp zconf.tab.c_shipped zconf.tab.c
76 zconf.tab.h: zconf.tab.h_shipped
77 cp zconf.tab.h_shipped zconf.tab.h
81 rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \
82 conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h
83 $(MAKE) -C lxdialog clean