Introduce autotools
[ipfire.org.git] / Makefile.am
1 #!/usr/bin/make
2
3 AM_MAKEFLAGS = --no-print-directory
4 AUTOMAKE_OPTIONS = color-tests
5
6 # remove target it the command fails
7 .DELETE_ON_ERROR:
8
9 # keep itermediate files
10 .SECONDARY:
11
12 pythondir = $(pyexecdir)
13
14 configsdir = $(sysconfdir)/ipfire.org
15 crondir = $(sysconfdir)/cron.d
16
17 CLEANFILES =
18 DISTCLEANFILES =
19 EXTRA_DIST =
20 INSTALL_DIRS =
21 noinst_DATA =
22
23 DISTCHECK_CONFIGURE_FLAGS = \
24 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
25
26 # ------------------------------------------------------------------------------
27
28 bin_SCRIPTS = \
29 src/scripts/ipfire.org \
30 src/scripts/ipfire.org-webapp
31
32 EXTRA_DIST += \
33 src/scripts/ipfire.org.in \
34 src/scripts/ipfire.org-webapp.in
35
36 CLEANFILES += \
37 src/scripts/ipfire.org \
38 src/scripts/ipfire.org-webapp
39
40 configs_DATA = \
41 ipfire.org.conf.sample
42
43 EXTRA_DIST += \
44 ipfire.org.conf.sample.in
45
46 CLEANFILES += \
47 ipfire.org.conf.sample
48
49 backend_PYTHON = \
50 src/backend/__init__.py \
51 src/backend/accounts.py \
52 src/backend/ads.py \
53 src/backend/asterisk.py \
54 src/backend/base.py \
55 src/backend/countries.py \
56 src/backend/database.py \
57 src/backend/fireinfo.py \
58 src/backend/geoip.py \
59 src/backend/iuse.py \
60 src/backend/memcached.py \
61 src/backend/mirrors.py \
62 src/backend/misc.py \
63 src/backend/netboot.py \
64 src/backend/news.py \
65 src/backend/nopaste.py \
66 src/backend/planet.py \
67 src/backend/releases.py \
68 src/backend/settings.py \
69 src/backend/talk.py \
70 src/backend/tracker.py \
71 src/backend/util.py \
72 src/backend/zeiterfassung.py
73
74 backenddir = $(pythondir)/ipfire
75
76 # ------------------------------------------------------------------------------
77
78 web_PYTHON = \
79 src/web/__init__.py \
80 src/web/handlers.py \
81 src/web/handlers_accounts.py \
82 src/web/handlers_admin.py \
83 src/web/handlers_base.py \
84 src/web/handlers_boot.py \
85 src/web/handlers_download.py \
86 src/web/handlers_fireinfo.py \
87 src/web/handlers_iuse.py \
88 src/web/handlers_mirrors.py \
89 src/web/handlers_news.py \
90 src/web/handlers_nopaste.py \
91 src/web/handlers_planet.py \
92 src/web/handlers_rss.py \
93 src/web/handlers_talk.py \
94 src/web/ui_modules.py
95
96 webdir = $(backenddir)/web
97
98 # ------------------------------------------------------------------------------
99
100 # TODO install the base for now and add all other templates later
101
102 templates_DATA = \
103 src/templates/base.html
104
105 templatesdir = $(datadir)/templates
106
107 # ------------------------------------------------------------------------------
108
109 SCSS_FILES = \
110 src/scss/style.scss \
111 src/scss/_buttons.scss \
112 src/scss/_donation.scss \
113 src/scss/_fonts.scss \
114 src/scss/_icons.scss \
115 src/scss/_nav.scss
116
117 EXTRA_DIST += \
118 src/templates/messages/main.scss
119
120 CLEANFILES += \
121 src/templates/messages/main.css
122
123 static_DATA = \
124 src/scss/main.css
125
126 CLEANFILES += \
127 src/scss/main.css
128
129 EXTRA_DIST += \
130 $(SCSS_FILES)
131
132 staticdir = $(datadir)/static
133
134 static_fonts_DATA = \
135 # TODO
136
137 static_fontsdir = $(staticdir)/fonts
138
139 static_images_DATA = \
140 # TODO
141
142 static_imagesdir = $(staticdir)/images
143
144 static_js_DATA = \
145 # TODO
146
147 static_jsdir = $(staticdir)/js
148
149 # ------------------------------------------------------------------------------
150
151 dist_cron_DATA = \
152 src/crontab/ipfire.org
153
154 # ------------------------------------------------------------------------------
155
156 if HAVE_SYSTEMD
157 systemdsystemunit_DATA = \
158 src/systemd/ipfire.org-webapp-1.service \
159 src/systemd/ipfire.org-webapp-2.service \
160 src/systemd/ipfire.org-webapp-3.service \
161 src/systemd/ipfire.org-webapp-4.service
162
163 CLEANFILES += \
164 $(systemdsystemunit_DATA)
165
166 INSTALL_DIRS += \
167 $(systemdsystemunitdir)
168 endif
169
170 EXTRA_DIST += \
171 src/systemd/ipfire.org-webapp-1.service.in \
172 src/systemd/ipfire.org-webapp-3.service.in \
173 src/systemd/ipfire.org-webapp-3.service.in \
174 src/systemd/ipfire.org-webapp-4.service.in
175
176 # ------------------------------------------------------------------------------
177
178 substitutions = \
179 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
180 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
181 '|configsdir=$(configsdir)|' \
182 '|bindir=$(bindir)|' \
183 '|datadir=$(datadir)|'
184
185 SED_PROCESS = \
186 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
187 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
188 < $< > $@
189
190 %: %.in Makefile
191 $(SED_PROCESS)
192
193 %.css: %.scss Makefile
194 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
195 $(SASSC) --style compressed $< > $@
196
197 src/scss/main.css: $(SCSS_FILES) Makefile
198 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
199 $(SASSC) --style compressed $< > $@