This puts all files generated by command_util.bash into a new
subdirectory inside the build directory. This way we don't need
to special-case these files any more in .gitignore, Doxyfile, make
clean. The compiler and depend.sh need to know this directory, so
we add -I$(cmdlist_dir) to CPPFLAGS and introduce a new parameter
for depend.sh.
To prevent cpp from including stale versions of the *command_list.h
files in the top level directory (left over from a previous build)
this commit renames the generated files slightly. For example,
audiod_completion.h becomes audiod.completion.h.
config.status
Makefile
TODO
config.status
Makefile
TODO
-*_command_list.h
-*_command_list.man
paraslash-git.tar.bz2
web/dia/overview.pdf
*.swp
paraslash-git.tar.bz2
web/dia/overview.pdf
*.swp
conftest
conftest.c
git-version.h
conftest
conftest.c
git-version.h
EXCLUDE_PATTERNS = *.cmdline.* \
gcc-compat.h \
fade.c \
EXCLUDE_PATTERNS = *.cmdline.* \
gcc-compat.h \
fade.c \
- *_command_list.h \
- *_completion.h
+ *.command_list.h \
+ *.completion.h
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
dep_dir := $(build_dir)/deps
man_dir := $(build_dir)/man/man1
cmdline_dir := $(build_dir)/cmdline
dep_dir := $(build_dir)/deps
man_dir := $(build_dir)/man/man1
cmdline_dir := $(build_dir)/cmdline
+cmdlist_dir := $(build_dir)/cmdlist
m4depdir := $(build_dir)/m4deps
help2man_dir := $(build_dir)/help2man
hostbin_dir := $(build_dir)/host/bin
m4depdir := $(build_dir)/m4deps
help2man_dir := $(build_dir)/help2man
hostbin_dir := $(build_dir)/host/bin
endif
$(object_dir) $(man_dir) $(ggo_dir) $(cmdline_dir) $(dep_dir) $(m4depdir) \
endif
$(object_dir) $(man_dir) $(ggo_dir) $(cmdline_dir) $(dep_dir) $(m4depdir) \
- $(help2man_dir) $(hostbin_dir):
+ $(help2man_dir) $(hostbin_dir) $(cmdlist_dir):
$(Q) $(MKDIR_P) $@
# When in doubt, use brute force (Ken Thompson)
$(Q) $(MKDIR_P) $@
# When in doubt, use brute force (Ken Thompson)
CPPFLAGS += $(arch_cppflags)
CPPFLAGS += -I/usr/local/include
CPPFLAGS += -I$(cmdline_dir)
CPPFLAGS += $(arch_cppflags)
CPPFLAGS += -I/usr/local/include
CPPFLAGS += -I$(cmdline_dir)
+CPPFLAGS += -I$(cmdlist_dir)
CFLAGS += -Os
CFLAGS += -Wuninitialized
CFLAGS += -Os
CFLAGS += -Wuninitialized
-%_command_list.h: %.cmd %.c
+$(cmdlist_dir)/%.command_list.h: %.cmd %.c | $(cmdlist_dir)
@[ -z "$(Q)" ] || echo 'GEN $@'
$(Q) ./command_util.bash h < $< >$@
@[ -z "$(Q)" ] || echo 'GEN $@'
$(Q) ./command_util.bash h < $< >$@
-%_command_list.man: %.cmd %.c
+$(cmdlist_dir)/%.command_list.man: %.cmd %.c | $(cmdlist_dir)
@[ -z "$(Q)" ] || echo 'GEN $@'
$(Q) ./command_util.bash man < $< > $@
@[ -z "$(Q)" ] || echo 'GEN $@'
$(Q) ./command_util.bash man < $< > $@
-%_completion.h: %.cmd %.c
+$(cmdlist_dir)/%.completion.h: %.cmd %.c | $(cmdlist_dir)
@[ -z "$(Q)" ] || echo 'GEN $@'
$(Q) ./command_util.bash compl $(strip $(call TOUPPER,$(*F)))_COMPLETERS \
$(strip $(call TOUPPER,$(*F)))_COMMANDS < $< > $@
@[ -z "$(Q)" ] || echo 'GEN $@'
$(Q) ./command_util.bash compl $(strip $(call TOUPPER,$(*F)))_COMPLETERS \
$(strip $(call TOUPPER,$(*F)))_COMMANDS < $< > $@
-server_command_list.h server_command_list.man server_completion.h: command.c
-afs_command_list.h afs_command_list.man afs_completion.h: afs.c aft.c attribute.c
-audiod_command_list.h audiod_command_list.man audiod_completion.h: audiod_command.c
+$(cmdlist_dir)/server.command_list.h \
+$(cmdlist_dir)/server.command_list.man \
+$(cmdlist_dir)/server.completion.h \
+: command.c
-server_command_lists := server_command_list.man afs_command_list.man
-audiod_command_lists := audiod_command_list.man
-play_command_lists := play_command_list.man
+$(cmdlist_dir)/afs.command_list.h \
+$(cmdlist_dir)/afs.command_list.man \
+$(cmdlist_dir)/afs.completion.h \
+: afs.c aft.c attribute.c
+
+$(cmdlist_dir)/audiod,command_list.h \
+$(cmdlist_dir)/audiod,command_list.man \
+$(cmdlist_dir)/audiod,completion.h \
+: audiod_command.c
+
+server_command_lists := $(cmdlist_dir)/server.command_list.man \
+ $(cmdlist_dir)/afs.command_list.man
+audiod_command_lists := $(cmdlist_dir)/audiod.command_list.man
+play_command_lists := $(cmdlist_dir)/play.command_list.man
$(man_dir)/para_server.1: $(server_command_lists)
$(man_dir)/para_audiod.1: $(audiod_command_lists)
$(man_dir)/para_server.1: $(server_command_lists)
$(man_dir)/para_audiod.1: $(audiod_command_lists)
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
-$(dep_dir)/%.cmdline.d: $(cmdline_dir)/%.cmdline.c error2.h | $(dep_dir)
+$(dep_dir)/%.cmdline.d: $(cmdline_dir)/%.cmdline.c error2.h | $(dep_dir) $(cmdlist_dir)
@[ -z "$(Q)" ] || echo 'DEP $<'
$(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
@[ -z "$(Q)" ] || echo 'DEP $<'
$(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
+ $(cmdlist_dir) $(CPPFLAGS) $< > $@
-$(dep_dir)/%.d: %.c error2.h | $(dep_dir)
+$(dep_dir)/%.d: %.c error2.h | $(dep_dir) $(cmdlist_dir)
@[ -z "$(Q)" ] || echo 'DEP $<'
$(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
@[ -z "$(Q)" ] || echo 'DEP $<'
$(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
+ $(cmdlist_dir) $(CPPFLAGS) $< > $@
para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
para_write para_play para_audiod: LDFLAGS += $(ao_ldflags) $(core_audio_ldflags)
para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
para_write para_play para_audiod: LDFLAGS += $(ao_ldflags) $(core_audio_ldflags)
clean2: clean
@[ -z "$(Q)" ] || echo 'CLEAN2'
clean2: clean
@[ -z "$(Q)" ] || echo 'CLEAN2'
- $(Q) rm -f *_command_list.* *_completion.h
$(Q) rm -rf $(build_dir)
distclean: clean2 test-clean
@[ -z "$(Q)" ] || echo 'DISTCLEAN'
$(Q) rm -rf $(build_dir)
distclean: clean2 test-clean
@[ -z "$(Q)" ] || echo 'DISTCLEAN'
#include "sched.h"
#include "buffer_tree.h"
#include "interactive.h"
#include "sched.h"
#include "buffer_tree.h"
#include "interactive.h"
-#include "audiod_completion.h"
+#include "audiod.completion.h"
static struct sched sched;
static struct sched sched;
#include "write.h"
#include "fd.h"
#include "version.h"
#include "write.h"
#include "fd.h"
#include "version.h"
-#include "audiod_command_list.h"
+#include "audiod.command_list.h"
extern struct sched sched;
extern char *stat_item_values[NUM_STAT_ITEMS];
extern struct sched sched;
extern char *stat_item_values[NUM_STAT_ITEMS];
#ifdef HAVE_READLINE
#include "interactive.h"
#ifdef HAVE_READLINE
#include "interactive.h"
-#include "server_completion.h"
-#include "afs_completion.h"
+#include "server.completion.h"
+#include "afs.completion.h"
struct exec_task {
struct task *task;
struct exec_task {
struct task *task;
#include "fd.h"
#include "ipc.h"
#include "user_list.h"
#include "fd.h"
#include "ipc.h"
#include "user_list.h"
-#include "server_command_list.h"
-#include "afs_command_list.h"
+#include "server.command_list.h"
+#include "afs.command_list.h"
#include "signal.h"
#include "version.h"
#include "signal.h"
#include "version.h"
# the given input file and parse the output to add a *.d target with the same
# dependencies.
# the given input file and parse the output to add a *.d target with the same
# dependencies.
-# The first three arguments to that script are special: $1 is the
+# The first four arguments to that script are special: $1 is the
# dependency directory and $2 is the object directory. These are used
# to prefix the .d and .o targets respectively. $3 is the directory
# dependency directory and $2 is the object directory. These are used
# to prefix the .d and .o targets respectively. $3 is the directory
-# that contains the *.cmdline.h files generated by gengetopt.
+# that contains the *.cmdline.h files generated by gengetopt. Similarly,
+# $4 is the command list directory which contains all files generated by
+# the command_util script.
# As gcc outputs the dependencies on the *.cmdline.h files either as
# foo.cmdline.h or as $cmdline_dir/foo.cmdline.h, depending on whether the
# As gcc outputs the dependencies on the *.cmdline.h files either as
# foo.cmdline.h or as $cmdline_dir/foo.cmdline.h, depending on whether the
dep_dir="$1"
object_dir="$2"
cmdline_dir="$3"
dep_dir="$1"
object_dir="$2"
cmdline_dir="$3"
shift
shift
shift
LC_ALL=C cc -MM -MG "$@" \
| sed -e "s@^\(.*\)\.o:@$dep_dir/\1.d $object_dir/\1.o:@" \
shift
shift
shift
LC_ALL=C cc -MM -MG "$@" \
| sed -e "s@^\(.*\)\.o:@$dep_dir/\1.d $object_dir/\1.o:@" \
- -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.cmdline.h\)@ $cmdline_dir/\1@g"
+ -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.cmdline.h\)@ $cmdline_dir/\1@g" \
+ -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.command_list.h\)@ $cmdlist_dir/\1@g" \
+ -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.completion.h\)@ $cmdlist_dir/\1@g"
-#include "play_completion.h"
+#include "play.completion.h"
/* defines one command of para_play */
/* defines one command of para_play */
-#include "play_command_list.h"
+#include "play.command_list.h"
static struct pp_command pp_cmds[] = {DEFINE_PLAY_CMD_ARRAY};
#define FOR_EACH_COMMAND(c) for (c = 0; pp_cmds[c].name; c++)
static struct pp_command pp_cmds[] = {DEFINE_PLAY_CMD_ARRAY};
#define FOR_EACH_COMMAND(c) for (c = 0; pp_cmds[c].name; c++)
-#include "play_completion.h"
+#include "play.completion.h"
static struct i9e_completer pp_completers[];
I9E_DUMMY_COMPLETER(jmp);
static struct i9e_completer pp_completers[];
I9E_DUMMY_COMPLETER(jmp);