source: trunk/Maketype@ 109

Last change on this file since 109 was 21, checked in by smurzch2, 12 years ago

Rename from MpCS to OSCam

File size: 2.4 KB
Line 
1SHELL = /bin/sh
2
3ifeq ($(wildcard oscam-boxkeys.np), oscam-boxkeys.np)
4 KFLAG = -DCS_WITH_BOXKEYS
5endif
6
7CC = $(DS_CC)
8AR = $(DS_AR)
9STRIP = $(DS_ST)
10RANLIB = $(DS_RL)
11CFLAGS = $(DS_OPTS) $(KFLAG) $(DS_CFLAGS)
12LDFLAGS = $(DS_OPTS) $(DS_LDFLAGS)
13ARFLAGS = $(DS_ARFLAGS)
14LIBS = $(DS_LIBS) $(OS_LIBS) $(OS_PTLI)
15export CC AR STRIP RANLIB CFLAGS LDFLAGS ARFLAGS
16
17GENERAL = Makefile Maketype globals.h oscam-config.h
18ifeq ($(wildcard csgbox), csgbox)
19 VERX = -gbx-$(subst ",,$(filter-out \#define GBXVERSION,$(shell grep GBXVERSION csgbox/gbox.h)))
20endif
21EXEFILE1 = Distribution/oscam-$(VER)$(VERX)-$(subst cygwin,cygwin.exe,$(TYP))
22
23
24LIBDIR = lib
25LIBFILE1 = $(LIBDIR)/libcs-$(TYP).a
26LIBFILE2 = $(LIBDIR)/libcscrypt-$(TYP).a
27LIBFILE3 = $(LIBDIR)/libcsctapi-$(TYP).a
28
29OBJECTS1 = $(LIBFILE1)(oscam-simples.o) \
30 $(LIBFILE1)(oscam-config.o) \
31 $(LIBFILE1)(oscam-log.o) \
32 $(LIBFILE1)(oscam-reader.o) \
33 $(LIBFILE1)(reader-common.o) \
34 $(LIBFILE1)(reader-irdeto.o) \
35 $(LIBFILE1)(reader-viaccess.o) \
36 $(LIBFILE1)(reader-videoguard2.o) \
37 $(LIBFILE1)(reader-seca.o) \
38 $(LIBFILE1)(reader-cryptoworks.o) \
39 $(LIBFILE1)(reader-conax.o) \
40 $(LIBFILE1)(module-camd33.o) \
41 $(LIBFILE1)(module-camd35.o) \
42 $(LIBFILE1)(module-radegast.o) \
43 $(LIBFILE1)(module-serial.o) \
44 $(LIBFILE1)(module-monitor.o) \
45 $(LIBFILE1)(module-newcamd.o) \
46 $(LIBFILE1)(oscam-nano.o) \
47 $(LIBFILE1)(oscam-chk.o) \
48 $(LIBFILE1)(oscam-ac.o)
49
50all: prepare $(EXEFILE1)
51
52prepare:
53 @-echo "-----------------------------------------------------"
54 @-echo "Build for platform $(TYP)"
55 @-echo "-----------------------------------------------------"
56 @echo "$(TYP)" | awk -F- ' \
57 { \
58 printf("#define CS_OSTYPE \"%s\"\n", $$0); \
59 printf("#define CS_OS_CPU \"%s\"\n", $$1); \
60 printf("#define CS_OS_HW \"%s\"\n", $$2); \
61 printf("#define CS_OS_SYS \"%s\"\n", $$3); \
62 }' > oscam-ostype.h
63 @[ -d "$(LIBDIR)" ] || mkdir "$(LIBDIR)"
64ifeq ($(wildcard csgbox), csgbox)
65 @-echo "#define CS_WITH_GBOX 1" >> oscam-ostype.h
66 $(MAKE) -C csgbox
67endif
68 $(MAKE) -C cscrypt
69 $(MAKE) -C csctapi
70
71$(EXEFILE1): oscam.c $(LIBFILE1) $(LIBFILE2) $(LIBFILE3) $(GENERAL)
72 $(CC) $(LDFLAGS) oscam.c $(LIBFILE1) $(LIBFILE2) $(LIBFILE3) -o "$@" $(LIBS)
73 $(STRIP) $@
74
75$(LIBFILE1): $(OBJECTS1)
76 -$(RANLIB) $@
77
78$(OBJECTS1): $(GENERAL)
79
80.c.a:
81 $(CC) $(CFLAGS) -Icsctapi $<
82 $(AR) $(ARFLAGS) $@ $*.o
83 -@rm -f $*.o
84
85.SUFFIXES: .o .c .a
Note: See TracBrowser for help on using the repository browser.