switch to a single rule for all command lists
[paraslash.git] / Makefile.in
index e416d53e261a01dc13f85d6218561b3d37a33c81..6ff6a016a49c5684a26f1dbdf12fb38cd0fef90c 100644 (file)
@@ -148,49 +148,9 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
                --set-package="para_$(subst .cmdline,,$(*F))" \
                --set-version="$V"  < $<
 
-server_command_list.c: server.cmd server_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "server_command_list.h"' >> $@
-       echo 'struct server_command cmd_struct[] = {' >>$@
-       ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
-server_command_list.h: server.cmd
-       echo 'extern struct server_command cmd_struct[];' > $@
-       ./command_util.sh proto < $< >> $@
-
-mysql_selector_command_list.c: mysql_selector.cmd mysql_selector_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "mysql_selector_command_list.h"' >> $@
-       echo 'struct server_command cmds[] = {' >>$@
-       ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
-mysql_selector_command_list.h: mysql_selector.cmd
-       echo 'extern struct server_command cmds[];' > $@
-       ./command_util.sh proto < $< >> $@
-
-random_selector_command_list.c: random_selector.cmd random_selector_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "random_selector_command_list.h"' >> $@
-       echo 'struct server_command random_selector_cmds[] = {' >>$@
-       ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
-random_selector_command_list.h: random_selector.cmd
-       echo 'extern struct server_command random_selector_cmds[];' > $@
-       ./command_util.sh proto < $< >> $@
-
-playlist_selector_command_list.c: playlist_selector.cmd playlist_selector_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "playlist_selector_command_list.h"' >> $@
-       echo 'struct server_command playlist_selector_cmds[] = {' >>$@
-       ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
-playlist_selector_command_list.h: playlist_selector.cmd
-       echo 'extern struct server_command playlist_selector_cmds[];' > $@
-       ./command_util.sh proto < $< >> $@
+%_command_list.c %_command_list.h: %.cmd
+       ./command_util.sh c < $< >$@
+       ./command_util.sh h < $< >$(@:%.c=%.h)
 
 ortp_recv.o: ortp_recv.c
        $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<