source: trunk/Makefile@ 70

Last change on this file since 70 was 70, checked in by rorothetroll, 12 years ago

csctapi/io_serial.c : fix the serial port read/write wait routine to use select instead of poll

This make them compatible with Mac OS X and now oscamd works on OS X. The same code off course
still works on linux and other unix platforms. I let that code ran for 24h before commiting this code.
If you have any issue let me know and I'llr evert to poll for non compatible machines.

all the others : fix all the warning due to sign difference (mostly uchar versus char). This make the code compile

with -Werror on the more strict version of gcc (which is the case on OS X). I also noticed that in a lot of places
the code use a buffer defined as an uchar * ... and use strings functions (strnXXXX) where some memcpy/memcmp .. function
would have been preferable as we're suposedly manipulation a binary buffer. Anyway I fixed all of them and it now compile
without any warning or error on linux and OS X (and also probably on all the other unices but we will have to try before
adding -Werror on the other platform).

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