1
2if DRI
3DRI_SUBDIR = dri
4DRI_LIB = dri/libdri.la
5endif
6
7if DRI2
8DRI2_SUBDIR = dri2
9DRI2_LIB = dri2/libdri2.la
10endif
11
12if DRI3
13DRI3_BUILDDIR = $(top_builddir)/dri3
14DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la
15endif
16
17if GLX
18GLXVND_LIB = $(top_builddir)/glx/libglxvnd.la
19endif
20
21if GLAMOR_EGL
22GLAMOR_EGL_SUBDIR = glamor_egl
23endif
24
25if XF86UTILS
26XF86UTILS_SUBDIR = utils
27endif
28
29if VGAHW
30VGAHW_SUBDIR = vgahw
31endif
32
33if INT10MODULE
34INT10_SUBDIR = int10
35endif
36
37SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
38	  ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
39	  $(DRI2_SUBDIR) . i2c dixmods xkb \
40	  fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \
41	  $(GLAMOR_EGL_SUBDIR) drivers
42
43DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
44               parser ramdac shadowfb vgahw \
45               loader dixmods xkb dri dri2 exa modes \
46	       utils doc man glamor_egl drivers
47
48bin_PROGRAMS = Xorg
49nodist_Xorg_SOURCES = sdksyms.c
50
51AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
52AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser \
53	-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
54	-I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3
55
56LOCAL_LIBS = \
57            $(MAIN_LIB) \
58            $(XSERVER_LIBS) \
59            loader/libloader.la \
60            common/libcommon.la \
61            os-support/libxorgos.la \
62            parser/libxf86config.la \
63            dixmods/libdixmods.la \
64            modes/libxf86modes.la \
65            ramdac/libramdac.la \
66            ddc/libddc.la \
67            i2c/libi2c.la \
68            $(XORG_LIBS) \
69            xkb/libxorgxkb.la \
70            $(DRI_LIB) \
71            $(DRI2_LIB) \
72	    $(DRI3_LIB) \
73	    $(GLXVND_LIB) \
74	    $(top_builddir)/fb/libfb.la \
75	    $(top_builddir)/miext/sync/libsync.la \
76            $(top_builddir)/mi/libmi.la \
77            $(top_builddir)/os/libos.la \
78	    $(top_builddir)/Xext/libXvidmode.la
79
80Xorg_LDADD = \
81            $(LOCAL_LIBS) \
82            $(XORG_SYS_LIBS) \
83            $(XSERVER_SYS_LIBS)
84Xorg_DEPENDENCIES = $(LOCAL_LIBS)
85
86Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
87
88if SUID_WRAPPER
89wrapexecdir = $(SUID_WRAPPER_DIR)
90wrapexec_PROGRAMS = Xorg.wrap
91Xorg_wrap_SOURCES = xorg-wrapper.c
92endif
93
94BUILT_SOURCES = xorg.conf.example
95DISTCLEANFILES = xorg.conf.example
96EXTRA_DIST = xorgconf.cpp
97
98# Without logdir, X will post an error on the terminal and will not start
99install-data-local:
100	$(AM_V_GEN)$(MKDIR_P) $(DESTDIR)$(logdir)
101if CYGWIN
102	$(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a
103endif
104
105install-exec-hook:
106	(cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg$(EXEEXT) X)
107if INSTALL_SETUID
108	chown 0 $(DESTDIR)$(bindir)/Xorg
109	chmod u+s $(DESTDIR)$(bindir)/Xorg
110endif
111if SUID_WRAPPER
112	$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
113	mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
114	${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
115	-chown 0 $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
116endif
117
118uninstall-local:
119if CYGWIN
120	$(AM_V_at)rm -f $(DESTDIR)$(libdir)/libXorg.exe.a
121endif
122
123uninstall-hook:
124	$(AM_V_at)rm -f $(DESTDIR)$(bindir)/X
125
126# Use variables from XORG_MANPAGE_SECTIONS and X Server configuration
127# Do not include manpages.am as values are not appropriate for rc files
128CONF_SUBSTS =	-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' \
129		-e 's|MODULEPATH|$(DEFAULT_MODULE_PATH)|g' \
130		-e 's|DEFAULTFONTPATH|$(COMPILEDDEFAULTFONTPATH)|g'
131
132xorg.conf.example: xorgconf.cpp
133	$(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@
134
135relink:
136	$(AM_V_at)rm -f Xorg$(EXEEXT) && $(MAKE) Xorg$(EXEEXT)
137
138CLEANFILES = sdksyms.c sdksyms.dep Xorg.sh
139EXTRA_DIST += sdksyms.sh
140
141sdksyms.dep sdksyms.c: sdksyms.sh
142	$(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
143
144SDKSYMS_DEP = sdksyms.dep
145-include $(SDKSYMS_DEP)
146
147i2c/libi2c.la:
148	$(AM_V_at)cd i2c && $(MAKE) libi2c.la
149
150dixmods/libdixmods.la:
151	$(AM_V_at)cd dixmods && $(MAKE) libdixmods.la
152
153xkb/libxorgxkb.la:
154	$(AM_V_at)cd xkb && $(MAKE) libxorgxkb.la
155