Use curses_cppflags only for building gui.o.
[paraslash.git] / Makefile.in
index 3fbbce21ab5f3fe91d674750a4d3f7804c346188..ff5150b6e2f1f22904665e234ffc5ace51cecf01 100644 (file)
@@ -54,7 +54,6 @@ CPPFLAGS += -Wbad-function-cast
 CPPFLAGS += -fno-strict-aliasing
 CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
 CPPFLAGS += @SSL_CPPFLAGS@
-CPPFLAGS += @ncurses_cppflags@
 CPPFLAGS += @arch_cppflags@
 CPPFLAGS += -I/usr/local/include
 CPPFLAGS += -I$(cmdline_dir)
@@ -99,9 +98,10 @@ else
        Q = @
 endif
 
-.PHONY: all clean distclean maintainer-clean install man tarball\
+.PHONY: dep all clean distclean maintainer-clean install man tarball\
        .FORCE-GIT-VERSION-FILE
-all: @executables@ $(man_pages)
+all: dep @executables@ $(man_pages)
+dep: $(deps)
 man: $(man_pages)
 tarball: $(tarball)
 
@@ -193,6 +193,10 @@ $(object_dir)/aac_afh.o: aac_afh.c | $(object_dir)
        @[ -z "$(Q)" ] || echo 'CC $<'
        $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
 
+$(object_dir)/gui%.o: gui%.c | $(object_dir)
+       @[ -z "$(Q)" ] || echo 'CC $<'
+       $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @curses_cppflags@ $<
+
 $(object_dir)/%.cmdline.o: $(cmdline_dir)/%.cmdline.c $(cmdline_dir)/%.cmdline.h | $(object_dir)
        @[ -z "$(Q)" ] || echo 'CC $<'
        $(Q) $(CC) -c $(CPPFLAGS) -Wno-unused-function -o $@ $<
@@ -209,6 +213,7 @@ $(object_dir)/%.d: %.c | $(object_dir)
        @[ -z "$(Q)" ] || echo 'DEP $<'
        $(Q) ./depend.sh $(object_dir) $(cmdline_dir) $(CPPFLAGS) $< > $@
 
+
 recv_objs := $(addprefix $(object_dir)/, @recv_objs@)
 filter_objs := $(addprefix $(object_dir)/, @filter_objs@)
 client_objs := $(addprefix $(object_dir)/, @client_objs@)
@@ -224,8 +229,10 @@ all_objs := $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \
        $(audiod_objs) $(audioc_objs) $(fade_objs) $(server_objs) \
        $(write_objs) $(afh_objs)
 
+deps := $(all_objs:.o=.d)
+
 ifeq ($(findstring clean, $(MAKECMDGOALS)),)
--include $(all_objs:.o=.d)
+-include $(deps)
 endif
 
 para_recv: $(recv_objs)
@@ -242,7 +249,7 @@ para_client: $(client_objs)
 
 para_gui: $(gui_objs)
        @[ -z "$(Q)" ] || echo 'LD $@'
-       $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lncurses
+       $(Q) $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lcurses
 
 para_audiod: audiod_command_list.c audiod_command_list.h $(audiod_objs)
        @[ -z "$(Q)" ] || echo 'LD $@'