source: trunk/Makefile@ 109

Last change on this file since 109 was 101, checked in by smurzch2, 11 years ago

Add Fonera2 target

File size: 15.3 KB
Line 
1SHELL = /bin/sh
2
3VER = $(subst ",,$(filter-out \#define CS_VERSION,$(shell grep CS_VERSION globals.h)))
4CS_CONFDIR = '\"/usr/local/etc\"'
5
6export VER
7
8linux: i386-pc-linux
9freebsd: i386-pc-freebsd
10tuxbox: cross-powerpc-tuxbox-linux
11win: cross-i386-pc-cygwin
12cygwin: i386-pc-cygwin
13macosx: macosx-native
14
15std: linux \
16 macosx \
17 cross-i386-pc-cygwin \
18 cross-powerpc-tuxbox-linux \
19 cross-i386-pc-freebsd \
20 cross-arm-nslu2-linux \
21 cross-mipsel-router-linux-uclibc927 \
22 cross-mipsel-router-linux-uclibc928 \
23 cross-mipsel-tuxbox-linux-glibc \
24 cross-mipsel-fonera2 \
25 cross-sh4-linux
26
27all: \
28 cross-sparc-sun-solaris2.7 \
29 cross-rs6000-ibm-aix4.2 \
30 cross-mips-sgi-irix6.5
31
32
33dist: std
34 @cd Distribution && tar cvf "../oscam$(VER).tar" *
35 @bzip2 -9f "oscam$(VER).tar"
36
37extra: all
38 @cd Distribution && tar cvf "../oscam$(VER)-extra.tar" *
39 @bzip2 -9f "oscam$(VER)-extra.tar"
40
41clean:
42 @-rm -rf oscam-ostype.h lib Distribution/oscam-*
43
44tar: clean
45 @tar cvf "oscam$(VER)-src.tar" Distribution Make* *.c *.h cscrypt csctapi
46 @bzip2 -9f "oscam$(VER)-src.tar"
47
48nptar: clean
49 @tar cvf "oscam$(VER)-nonpublic-src.tar" Distribution Make* *.c *.np *.h cscrypt csctapi csgbox
50 @bzip2 -9f "oscam$(VER)-nonpublic-src.tar"
51
52######################################################################
53#
54# LINUX native
55#
56######################################################################
57i386-pc-linux:
58 @-$(MAKE) --no-print-directory \
59 -f Maketype TYP=$(subst i386,$(shell uname --machine),$(subst cross-,,$@)) \
60 OS_LIBS="-lcrypto" \
61 OS_CULI="-lncurses" \
62 OS_PTLI="-lpthread" \
63 DS_OPTS="-O3 -DOS_LINUX -DCS_CONFDIR=${CS_CONFDIR} -Winline -Werror -finline-functions -fomit-frame-pointer" \
64 DS_CFLAGS="-c" \
65 DS_LDFLAGS="" \
66 DS_ARFLAGS="-rvsl" \
67 DS_CC=gcc \
68 DS_AR=ar \
69 DS_LD=ld \
70 DS_RL=ranlib \
71 DS_ST=strip
72
73######################################################################
74#
75# MacOSX native
76#
77######################################################################
78macosx-native:
79 @-$(MAKE) --no-print-directory \
80 -f Maketype TYP=$(subst cross-,,$@) \
81 OS_LIBS="-lcrypto" \
82 OS_CULI="-lncurses" \
83 OS_PTLI="-lpthread" \
84 DS_OPTS="-O2 -DOS_MACOSX -DNEED_DAEMON -DCS_NOSHM -DHAVE_PTHREAD_H -DUSE_PTHREAD -DCS_CONFDIR=${CS_CONFDIR} -Winline -Werror -finline-functions -fomit-frame-pointer" \
85 DS_CFLAGS="-c" \
86 DS_LDFLAGS="" \
87 DS_ARFLAGS="-rvsl" \
88 DS_CC=gcc \
89 DS_AR=ar \
90 DS_LD=ld \
91 DS_RL=ranlib \
92 DS_ST=strip
93
94
95######################################################################
96#
97# FreeBSD native
98#
99######################################################################
100i386-pc-freebsd:
101 @-$(MAKE) --no-print-directory \
102 -f Maketype TYP=$(subst cross-,,$@) \
103 OS_LIBS="" \
104 OS_CULI="-lncurses" \
105 OS_PTLI="-lpthread" \
106 DS_OPTS="-O2 -DOS_FREEBSD -DBSD_COMP -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
107 DS_CFLAGS="-c" \
108 DS_LDFLAGS="" \
109 DS_ARFLAGS="-rvsl" \
110 DS_CC=gcc \
111 DS_AR=ar \
112 DS_LD=ld \
113 DS_RL=ranlib \
114 DS_ST=strip
115
116######################################################################
117#
118# FreeBSD 5.4 crosscompiler
119#
120######################################################################
121cross-i386-pc-freebsd:
122 @-$(MAKE) --no-print-directory \
123 -f Maketype TYP=$(subst cross-,,$@) \
124 OS_LIBS="" \
125 OS_CULI="-lncurses" \
126 OS_PTLI="-lpthread" \
127 DS_OPTS="-O2 -DOS_FREEBSD -DBSD_COMP -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
128 DS_CFLAGS="-c" \
129 DS_LDFLAGS="" \
130 DS_ARFLAGS="-rvsl" \
131 DS_CC=i386-pc-freebsd5.4-gcc \
132 DS_AR=i386-pc-freebsd5.4-ar \
133 DS_LD=i386-pc-freebsd5.4-ld \
134 DS_RL=i386-pc-freebsd5.4-ranlib \
135 DS_ST=i386-pc-freebsd5.4-strip
136
137######################################################################
138#
139# Tuxbox crosscompiler
140#
141######################################################################
142cross-powerpc-tuxbox-linux:
143 @-$(MAKE) --no-print-directory \
144 -f Maketype TYP=$(subst cross-,,$@) \
145 OS_LIBS="-lcrypto -ldl" \
146 OS_CULI="-lncurses" \
147 OS_PTLI="-lpthread" \
148 DS_OPTS="-O2 -DOS_LINUX -DTUXBOX -DPPC -DCS_CONFDIR=${CS_CONFDIR}" \
149 DS_CFLAGS="-c" \
150 DS_LDFLAGS="" \
151 DS_ARFLAGS="-rvsl" \
152 DS_CC=powerpc-tuxbox-linux-gnu-gcc \
153 DS_AR=powerpc-tuxbox-linux-gnu-ar \
154 DS_LD=powerpc-tuxbox-linux-gnu-ld \
155 DS_RL=powerpc-tuxbox-linux-gnu-ranlib \
156 DS_ST=powerpc-tuxbox-linux-gnu-strip
157
158cross-powerpc-tuxbox-linux-uclibc:
159 @-$(MAKE) --no-print-directory \
160 -f Maketype TYP=$(subst cross-,,$@) \
161 OS_LIBS="" \
162 OS_CULI="-lncurses" \
163 OS_PTLI="-lpthread" \
164 DS_OPTS="-O2 -DOS_LINUX -DTUXBOX -DPPC -DCS_CONFDIR=${CS_CONFDIR}" \
165 DS_CFLAGS="-c" \
166 DS_LDFLAGS="" \
167 DS_ARFLAGS="-rvsl" \
168 DS_CC=powerpc-tuxbox-linux-uclibc-gcc \
169 DS_AR=powerpc-tuxbox-linux-uclibc-ar \
170 DS_LD=powerpc-tuxbox-linux-uclibc-ld \
171 DS_RL=powerpc-tuxbox-linux-uclibc-ranlib \
172 DS_ST=powerpc-tuxbox-linux-uclibc-strip
173
174
175######################################################################
176#
177# sh4 crosscompiler
178#
179######################################################################
180cross-sh4-linux:
181 @-$(MAKE) --no-print-directory \
182 -f Maketype TYP=$(subst cross-,,$@) \
183 OS_LIBS="" \
184 OS_CULI="-lncurses" \
185 OS_PTLI="-lpthread" \
186 DS_OPTS="-O2 -DOS_LINUX -DCS_CONFDIR=${CS_CONFDIR}" \
187 DS_CFLAGS="-c" \
188 DS_LDFLAGS="" \
189 DS_ARFLAGS="-rvsl" \
190 DS_CC=/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-gcc \
191 DS_AR=/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-ar \
192 DS_LD=/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-ld \
193 DS_RL=/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-ranlib \
194 DS_ST=/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-strip
195
196######################################################################
197#
198# Cygwin crosscompiler
199#
200######################################################################
201cross-i386-pc-cygwin:
202 @-$(MAKE) --no-print-directory \
203 -f Maketype TYP=$(subst cross-,,$@) \
204 OS_LIBS="-lcrypto" \
205 OS_CULI="-lncurses" \
206 OS_PTLI="-lpthread" \
207 DS_OPTS="-O2 -DOS_CYGWIN32 -DCS_CONFDIR=${CS_CONFDIR}" \
208 DS_CFLAGS="-c" \
209 DS_LDFLAGS="" \
210 DS_ARFLAGS="-rvsl" \
211 DS_CC=i686-pc-cygwin-gcc \
212 DS_AR=i686-pc-cygwin-ar \
213 DS_LD=i686-pc-cygwin-ld \
214 DS_RL=i686-pc-cygwin-ranlib \
215 DS_ST=i686-pc-cygwin-strip
216
217######################################################################
218#
219# Cygwin native
220#
221######################################################################
222i386-pc-cygwin:
223 @-$(MAKE) --no-print-directory \
224 -f Maketype TYP=$(subst cross-,,$@) \
225 OS_LIBS="-lcrypto" \
226 OS_CULI="-lncurses" \
227 OS_PTLI="-lpthread" \
228 DS_OPTS="-O2 -DOS_CYGWIN32 -DCS_CONFDIR=${CS_CONFDIR} -I /tmp/include" \
229 DS_CFLAGS="-c" \
230 DS_LDFLAGS="" \
231 DS_ARFLAGS="-rvsl" \
232 DS_CC=gcc \
233 DS_AR=ar \
234 DS_LD=ld \
235 DS_RL=ranlib \
236 DS_ST=strip
237
238######################################################################
239#
240# Solaris 7 crosscompiler
241#
242######################################################################
243cross-sparc-sun-solaris2.7:
244 @-$(MAKE) --no-print-directory \
245 -f Maketype TYP=$(subst cross-,,$@) \
246 OS_LIBS="" \
247 OS_CULI="-lncurses" \
248 OS_PTLI="-lpthread" \
249 DS_OPTS="-O2 -DOS_SOLARIS -DOS_SOLARIS7 -DBSD_COMP -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
250 DS_CFLAGS="-c" \
251 DS_LDFLAGS="-lsocket" \
252 DS_ARFLAGS="-rvsl" \
253 DS_CC=sparc-sun-solaris2.7-gcc \
254 DS_AR=sparc-sun-solaris2.7-ar \
255 DS_LD=sparc-sun-solaris2.7-ld \
256 DS_RL=sparc-sun-solaris2.7-ranlib \
257 DS_ST=sparc-sun-solaris2.7-strip
258
259######################################################################
260#
261# OpenSolaris native compiler
262#
263######################################################################
264opensolaris:
265 @-$(MAKE) --no-print-directory \
266 -f Maketype TYP=$(subst cross-,,$@) \
267 OS_LIBS="-lcrypto -lnsl" \
268 OS_CULI="-lncurses" \
269 OS_PTLI="-lpthread" \
270 DS_OPTS="-O2 -DOS_SOLARIS -DOS_SOLARIS7 -DBSD_COMP -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
271 DS_CFLAGS="-c" \
272 DS_LDFLAGS="-lsocket" \
273 DS_ARFLAGS="-rvsl" \
274 DS_CC=gcc \
275 DS_AR=ar \
276 DS_LD=ld \
277 DS_RL=ranlib \
278 DS_ST=strip
279
280######################################################################
281#
282# AIX 4.2 crosscompiler
283#
284######################################################################
285cross-rs6000-ibm-aix4.2:
286 @-$(MAKE) --no-print-directory \
287 -f Maketype TYP=$(subst cross-,,$@) \
288 OS_LIBS="" \
289 OS_CULI="-lncurses" \
290 OS_PTLI="-lpthreads" \
291 DS_OPTS="-O2 -DOS_AIX -DOS_AIX42 -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
292 DS_CFLAGS="-c" \
293 DS_LDFLAGS="" \
294 DS_ARFLAGS="-rvsl" \
295 DS_CC=rs6000-ibm-aix4.2-gcc \
296 DS_AR=rs6000-ibm-aix4.2-ar \
297 DS_LD=rs6000-ibm-aix4.2-ld \
298 DS_RL=rs6000-ibm-aix4.2-ranlib \
299 DS_ST=rs6000-ibm-aix4.2-strip
300
301######################################################################
302#
303# IRIX 6.5 crosscompiler
304#
305######################################################################
306cross-mips-sgi-irix6.5:
307 @-$(MAKE) --no-print-directory \
308 -f Maketype TYP=$(subst cross-,,$@) \
309 OS_LIBS="" \
310 OS_CULI="-lncurses" \
311 OS_PTLI="-lpthread" \
312 DS_OPTS="-O2 -DOS_IRIX -DOS_IRIX65 -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
313 DS_CFLAGS="-c" \
314 DS_LDFLAGS="" \
315 DS_ARFLAGS="-rvsl" \
316 DS_CC=mips-sgi-irix6.5-gcc \
317 DS_AR=mips-sgi-irix6.5-ar \
318 DS_LD=mips-sgi-irix6.5-ld \
319 DS_RL=mips-sgi-irix6.5-ranlib \
320 DS_ST=mips-sgi-irix6.5-strip
321
322cross-mipsel-router-linux-uclibc: cross-mipsel-router-linux-uclibc928
323######################################################################
324#
325# Linux MIPS(LE) crosscompiler with ucLibc 0.9.27
326#
327######################################################################
328cross-mipsel-router-linux-uclibc927:
329 @-mipsel-linux-uclibc-setlib 0.9.27
330 @-$(MAKE) --no-print-directory \
331 -f Maketype TYP=$(subst cross-,,$@) \
332 OS_LIBS="" \
333 OS_CULI="-lncurses" \
334 OS_PTLI="-lpthread" \
335 DS_OPTS="-O2 -DOS_LINUX -DMIPSEL -DUCLIBC -DUSE_GPIO -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
336 DS_CFLAGS="-c" \
337 DS_LDFLAGS="" \
338 DS_ARFLAGS="-rvsl" \
339 DS_CC=mipsel-linux-uclibc-gcc \
340 DS_AR=mipsel-linux-uclibc-ar \
341 DS_LD=mipsel-linux-uclibc-ld \
342 DS_RL=mipsel-linux-uclibc-ranlib \
343 DS_ST=mipsel-linux-uclibc-strip
344
345######################################################################
346#
347# Linux MIPS(LE) crosscompiler with ucLibc 0.9.28
348#
349######################################################################
350cross-mipsel-router-linux-uclibc928:
351 @-mipsel-linux-uclibc-setlib 0.9.28
352 @-$(MAKE) --no-print-directory \
353 -f Maketype TYP=$(subst cross-,,$@) \
354 OS_LIBS="" \
355 OS_CULI="-lncurses" \
356 OS_PTLI="-lpthread" \
357 DS_OPTS="-O2 -DOS_LINUX -DMIPSEL -DUCLIBC -DUSE_GPIO -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
358 DS_CFLAGS="-c" \
359 DS_LDFLAGS="" \
360 DS_ARFLAGS="-rvsl" \
361 DS_CC=mipsel-linux-uclibc-gcc \
362 DS_AR=mipsel-linux-uclibc-ar \
363 DS_LD=mipsel-linux-uclibc-ld \
364 DS_RL=mipsel-linux-uclibc-ranlib \
365 DS_ST=mipsel-linux-uclibc-strip
366
367######################################################################
368#
369# Linux MIPS(LE) crosscompiler for La Fonera 2.0
370#
371######################################################################
372cross-mipsel-fonera2:
373 @-$(MAKE) --no-print-directory \
374 -f Maketype TYP=$(subst cross-,,$@) \
375 OS_LIBS="-Lopenssl-lib -lcrypto" \
376 OS_CULI="-lncurses" \
377 OS_PTLI="-lpthread" \
378 DS_OPTS="-Iopenssl-include -O2 -DOS_LINUX -DMIPSEL -DUCLIBC -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
379 DS_CFLAGS="-c" \
380 DS_LDFLAGS="" \
381 DS_ARFLAGS="-rvsl" \
382 DS_CC=mips-linux-gcc \
383 DS_AR=mips-linux-ar \
384 DS_LD=mips-linux-ld \
385 DS_RL=mips-linux-ranlib \
386 DS_ST=mips-linux-strip
387
388######################################################################
389#
390# Linux MIPS(LE) crosscompiler with glibc (DM7025)
391#
392######################################################################
393cross-mipsel-tuxbox-linux-glibc:
394 @-$(MAKE) --no-print-directory \
395 -f Maketype TYP=$(subst cross-,,$@) \
396 OS_LIBS="-lcrypto" \
397 OS_CULI="-lncurses" \
398 OS_PTLI="-lpthread" \
399 DS_OPTS="-O2 -DOS_LINUX -DTUXBOX -DMIPSEL -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
400 DS_CFLAGS="-c" \
401 DS_LDFLAGS="" \
402 DS_ARFLAGS="-rvsl" \
403 DS_CC=mipsel-linux-glibc-gcc \
404 DS_AR=mipsel-linux-glibc-ar \
405 DS_LD=mipsel-linux-glibc-ld \
406 DS_RL=mipsel-linux-glibc-ranlib \
407 DS_ST=mipsel-linux-glibc-strip
408
409cross-mipsel-tuxbox-linux:
410 @-$(MAKE) --no-print-directory \
411 -f Maketype TYP=$(subst cross-,,$@) \
412 OS_LIBS="-lcrypto" \
413 OS_CULI="-lncurses" \
414 OS_PTLI="-lpthread" \
415 DS_OPTS="-O2 -DOS_LINUX -DTUXBOX -DMIPSEL -DCS_CONFDIR=${CS_CONFDIR} -static-libgcc" \
416 DS_CFLAGS="-c" \
417 DS_LDFLAGS="" \
418 DS_ARFLAGS="-rvsl" \
419 DS_CC=mipsel-linux-gcc \
420 DS_AR=mipsel-linux-ar \
421 DS_LD=mipsel-linux-ld \
422 DS_RL=mipsel-linux-ranlib \
423 DS_ST=mipsel-linux-strip
424
425######################################################################
426#
427# HP/UX 10.20 native
428#
429######################################################################
430hppa1.1-hp-hpux10.20:
431 @-$(MAKE) --no-print-directory \
432 -f Maketype TYP=$(subst cross-,,$@) \
433 OS_LIBS="" \
434 OS_CULI="-lncurses" \
435 OS_PTLI="-lpthread" \
436 DS_OPTS="-O2 -DOS_HPUX -DOS_HPUX10 -D_XOPEN_SOURCE_EXTENDED -DCS_CONFDIR=${CS_CONFDIR}" \
437 DS_CFLAGS="-c" \
438 DS_LDFLAGS="" \
439 DS_ARFLAGS="-rvsl" \
440 DS_CC=gcc \
441 DS_AR=ar \
442 DS_LD=ld \
443 DS_RL=ranlib \
444 DS_ST=strip
445
446######################################################################
447#
448# OSF5.1 native
449#
450######################################################################
451alpha-dec-osf5.1:
452 @-$(MAKE) --no-print-directory \
453 -f Maketype TYP=$(subst cross-,,$@) \
454 OS_LIBS="" \
455 OS_CULI="-lncurses" \
456 OS_PTLI="-lpthread" \
457 DS_OPTS="-O2 -DOS_OSF -DOS_OSF5 -DCS_CONFDIR=${CS_CONFDIR}" \
458 XDS_CFLAGS="-I/usr/include -c" \
459 DS_CFLAGS="-c" \
460 DS_LDFLAGS="" \
461 DS_ARFLAGS="-rvsl" \
462 DS_CC=cc \
463 DS_AR=ar \
464 DS_LD=ld \
465 DS_RL=ranlib \
466 DS_ST=strip
467
468######################################################################
469#
470# ARM crosscompiler (big-endian)
471#
472######################################################################
473cross-arm-nslu2-linux:
474 @-$(MAKE) --no-print-directory \
475 -f Maketype TYP="$(subst cross-,,$@)" \
476 OS_LIBS="" \
477 OS_CULI="-lncurses" \
478 OS_PTLI="-lpthread" \
479 DS_OPTS="-DOS_LINUX -O2 -DARM -DALIGNMENT -DCS_CONFDIR=${CS_CONFDIR}" \
480 DS_CFLAGS="-c" \
481 DS_LDFLAGS="" \
482 DS_ARFLAGS="-rvsl" \
483 DS_AWK="awk" \
484 DS_CC="armv5b-softfloat-linux-gcc" \
485 DS_AR="armv5b-softfloat-linux-ar" \
486 DS_LD="armv5b-softfloat-linux-ld" \
487 DS_RL="armv5b-softfloat-linux-ranlib" \
488 DS_ST="armv5b-softfloat-linux-strip"
489
490######################################################################
491#
492# ARM crosscompiler (big-endian)
493#
494######################################################################
495cross-armBE-unkown-linux:
496 -$(MAKE) --no-print-directory \
497 -f Maketype TYP="$(subst cross-,,$@)" \
498 OS_LIBS="" \
499 OS_CULI="-lncurses" \
500 OS_PTLI="-lpthread" \
501 DS_OPTS="-DOS_LINUX -O2 -DARM -DALIGNMENT -DCS_CONFDIR=${CS_CONFDIR}" \
502 DS_CFLAGS="-c" \
503 DS_LDFLAGS="" \
504 DS_ARFLAGS="-rvsl" \
505 DS_AWK="awk" \
506 DS_CC="arm-linux-gcc -mbig-endian" \
507 DS_AR="arm-linux-ar" \
508 DS_LD="arm-linux-ld -EB" \
509 DS_RL="arm-linux-ranlib" \
510 DS_ST="arm-linux-strip"
511
512######################################################################
513#
514# ARM crosscompiler (little-endian)
515#
516######################################################################
517cross-armLE-unkown-linux:
518 -$(MAKE) --no-print-directory \
519 -f Maketype TYP="$(subst cross-,,$@)" \
520 OS_LIBS="" \
521 OS_CULI="-lncurses" \
522 OS_PTLI="-lpthread" \
523 DS_OPTS="-DOS_LINUX -O2 -DARM -DALIGNMENT -DCS_CONFDIR=${CS_CONFDIR}" \
524 DS_CFLAGS="-c" \
525 DS_LDFLAGS="" \
526 DS_ARFLAGS="-rvsl" \
527 DS_AWK="awk" \
528 DS_CC="arm-linux-gcc -mlittle-endian" \
529 DS_AR="arm-linux-ar" \
530 DS_LD="arm-linux-ld -EL" \
531 DS_RL="arm-linux-ranlib" \
532 DS_ST="arm-linux-strip"
Note: See TracBrowser for help on using the repository browser.