summaryrefslogtreecommitdiff
path: root/kconfig
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-02-05 07:39:01 (GMT)
committerAlexey Neyman <stilor@att.net>2018-04-07 19:03:17 (GMT)
commit9238b587210c53ba51dd665ffb9ff3e13456880f (patch)
tree9892738202b84042d190d80ecd20c64b060f8b03 /kconfig
parent576dcc3fee5b949cbf439fd95ab642dfcfe51a74 (diff)
WIP: autotoolization
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'kconfig')
-rw-r--r--kconfig/Makefile.am33
-rw-r--r--kconfig/Makefile.in118
2 files changed, 33 insertions, 118 deletions
diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am
new file mode 100644
index 0000000..dfb8617
--- /dev/null
+++ b/kconfig/Makefile.am
@@ -0,0 +1,33 @@
+## Process this file with automake to produce Makefile.in
+## vim: set noet :
+
+## TBD install into lib/crosstool-ng/kconfig?
+## TBD turn off program renaming for these? Or account for it in ct-ng script?
+pkglibexec_PROGRAMS = conf
+
+AM_LFLAGS = -L -Pzconf
+AM_YFLAGS = -l -b zconf -p zconf
+
+BUILT_SOURCES = zconf.c zconf.lex.c
+
+AM_CPPFLAGS = -include config.h -DCONFIG_=\"CT_\"
+conf_SOURCES = conf.c zconf.c
+
+# automake's support for yacc/lex/gperf is too idiosyncratic. It doesn't
+# support a common pattern of including lex-generated file into yacc, nor does
+# it support using a different base name for the generated C files.
+YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
+AM_V_YACC = $(am__v_YACC_@AM_V@)
+am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@)
+am__v_YACC_0 = @echo " YACC " $@;
+
+LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
+AM_V_LEX = $(am__v_LEX_@AM_V@)
+am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@)
+am__v_LEX_0 = @echo " LEX " $@;
+
+zconf.c: zconf.y
+ $(AM_V_YACC)$(YACCCOMPILE) -o$@ $<
+
+zconf.lex.c: zconf.l
+ $(AM_V_LEX)$(LEXCOMPILE) -o$@ $<
diff --git a/kconfig/Makefile.in b/kconfig/Makefile.in
deleted file mode 100644
index 71157d6..0000000
--- a/kconfig/Makefile.in
+++ /dev/null
@@ -1,118 +0,0 @@
-#-----------------------------------------------------------
-# Hmmm! Cheesy build!
-# Or: where I can unveil my make-fu... :-]
-
-install = @INSTALL@
-sed = @SED@
-gperf = @GPERF@
-CC = @CC@
-LIBS = @LIBS@
-
-V=1
-__silent = $(if $(V),,@printf ' %-7s %s\n' '$1' '$(if $2,$2,$(strip $<))' && )
-__silent_rm = $(call __silent,RM,$1)rm -f $1
-
-PROGS = conf mconf nconf
-
-all: $(PROGS)
- @true # Just be silent, you fscking son of a fscking beach...
-
-# Build flags
-CFLAGS = --include @top_builddir@/config.h -DCONFIG_=\"CT_\" \
- @CFLAGS@ @CPPFLAGS@
-LDFLAGS = @LDFLAGS@ @LIBINTL@
-
-# Compiler flags to use gettext
-ifneq (@USE_NLS@,yes)
-CFLAGS += -Wno-format-security -DKBUILD_NO_NLS
-endif
-
-# Common source files
-COMMON_SRC = zconf.tab.c
-COMMON_OBJ = $(patsubst %.c,%.o,$(COMMON_SRC))
-COMMON_DEP = $(patsubst %.o,%.dep,$(COMMON_OBJ))
-$(COMMON_OBJ) $(COMMON_DEP): CFLAGS += -I.
-
-# lxdialog source files
-LX_SRC = $(sort $(wildcard lxdialog/*.c))
-LX_OBJ = $(patsubst %.c,%.o,$(LX_SRC))
-LX_DEP = $(patsubst %.o,%.dep,$(LX_OBJ))
-$(LX_OBJ) $(LX_DEP): CFLAGS += @CURSES_CFLAGS@
-
-# What's needed to build 'conf'
-conf_SRC = conf.c
-conf_OBJ = $(patsubst %.c,%.o,$(conf_SRC))
-conf_DEP = $(patsubst %.o,%.dep,$(conf_OBJ))
-$(conf_OBJ) $(conf_DEP): CFLAGS +=
-
-# What's needed to build 'mconf'
-mconf_SRC = mconf.c
-mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC))
-mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))
-$(mconf_OBJ) $(mconf_DEP): CFLAGS += @CURSES_CFLAGS@
-mconf: LDFLAGS += @CURSES_LIBS@
-
-# What's needed to build 'nconf'
-nconf_SRC = nconf.c nconf.gui.c
-nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC))
-nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC))
-$(nconf_OBJ) $(nconf_DEP): CFLAGS +=
-nconf: LDFLAGS += @MENU_LIBS@ @PANEL_LIBS@ @CURSES_LIBS@
-
-# These are generated files:
-ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ) $(nconf_OBJ))
-ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP) $(nconf_DEP))
-
-# Cheesy auto-dependencies
-DEPS = $(COMMON_DEP)
-DEPS += $(conf_DEP)
-DEPS += $(mconf_DEP) $(LX_DEP)
-DEPS += $(nconf_DEP)
--include $(DEPS)
-
-# Build the dependency for C files
-%.dep: %.c
- $(call __silent,DEP,$@)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
-
-# Generate the grammar parser
-zconf.tab.o: zconf.tab.c zconf.lex.c
-zconf.tab.dep: zconf.tab.c zconf.lex.c
-
-.PRECIOUS: zconf.tab.c
-zconf.tab.c: zconf.y
- $(call __silent,BISON)bison -l -b zconf -p zconf $<
-
-zconf.lex.c: zconf.l
- $(call __silent,LEX)flex -L -Pzconf -o$@ $<
-
-# Build C files
-%.o: %.c
- $(call __silent,CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
-
-# Actual link
-mconf: $(COMMON_OBJ) $(LX_OBJ) $(mconf_OBJ)
- $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
-
-nconf: $(COMMON_OBJ) $(nconf_OBJ)
- $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
-
-conf: $(COMMON_OBJ) $(conf_OBJ)
- $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
-
-#-----------------------------------------------------------
-# Installation
-install: $(patsubst %,install-%,$(PROGS)) install-kconfig.mk
-
-$(patsubst %,install-%,$(PROGS)): install-%: %
- $(call __silent,INSTALL,$<)$(install) -m 0755 $< $(DESTDIR)/$<
-
-install-kconfig.mk: kconfig.mk
- $(call __silent,INSTALL,$<)$(install) -m 0644 $< $(DESTDIR)/$<
-
-#-----------------------------------------------------------
-# Cleaning up the mess...
-
-clean:
- $(call __silent,RM,objs)rm -f $(ALL_OBJS) $(ALL_DEPS)
- $(call __silent_rm,$(PROGS))
- $(call __silent_rm,zconf.tab.c zconf.lex.c lex.backup)