unfortunately, we cannot use time.h, there is a conflict name with std headers
[aversive.git] / config / scripts / Makefile
1 HEADER=header.tk
2 TAIL=tail.tk
3
4 # Previous versions always remade kconfig.tk because they always depended
5 # on soundscript.  This runs fairly fast, and I can't find all the
6 # Config.in files to depend on anyways.  So I'll force it to remake.
7
8 kconfig.tk: dummy
9
10 kconfig.tk: ${TOPDIR}/Makefile ${TOPDIR}/arch/${ARCH}/config.in \
11                 tkparse ${HEADER} ${TAIL}
12         @if [ -f /usr/local/bin/wish ]; then \
13                 echo '#!'"/usr/local/bin/wish -f" > kconfig.tk; \
14         else \
15                 echo '#!'"/usr/bin/wish -f" > kconfig.tk; \
16         fi
17         cat ${HEADER} >> ./kconfig.tk
18         ./tkparse < ../arch/${ARCH}/config.in >> kconfig.tk
19         echo "set defaults \"arch/${ARCH}/defconfig\"" >> kconfig.tk
20         echo "set ARCH \"${ARCH}\"" >> kconfig.tk
21         cat ${TAIL} >> kconfig.tk
22         chmod 755 kconfig.tk
23
24 tkparse: tkparse.o tkcond.o tkgen.o
25         ${HOSTCC} -o tkparse tkparse.o tkcond.o tkgen.o
26
27 tkparse.o: tkparse.c tkparse.h
28
29 tkcond.o: tkcond.c tkparse.h
30
31 tkgen.o: tkgen.c tkparse.h
32
33 tkparse.o tkcond.o tkgen.o:
34         $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(@:.o=.c)
35
36 clean:
37         rm -f *~ kconfig.tk *.o tkparse
38
39 # include $(TOPDIR)/Rules.make