if INCLUDED_GETOPT_LONG
-EXTRA_DIRS=getopt
+EXTRA_DIRS1=getopt
else
-EXTRA_DIRS=
+EXTRA_DIRS1=
endif
-SUBDIRS=$(EXTRA_DIRS) libcio libk libkmath libgraph libezplot libir src man html cgi-bin include
+if HAVE_SGP
+EXTRA_DIRS2=libctgraphics
+else
+EXTRA_DIRS2=
+endif
+
+if HAVE_WXWINDOWS
+EXTRA_DIRS3=src
+else
+EXTRA_DIRS3=
+endif
+
+SUBDIRS=man libctsupport libctsim html cgi-bin include $(EXTRA_DIRS1) $(EXTRA_DIRS2) $(EXTRA_DIRS3) tools helical
+
+EXTRA_DIST=acsite.m4 make.bat msvc/ctsim.dsw msvc/ctsimtext/ctsimtext.dsp msvc/libctsim/libctsim.dsp msvc/ctsim/ctsim.dsp
+
+install-data-hook:
+ test -d $(datadir) || mkdir -p $(datadir) && chmod 0755 $(datadir)
+ install -g root -o root -m 0644 docs/ctsim.htb $(datadir)