Added globbing support for all searchpaths! (can now search /media/*/pandora/apps...
[pandora-libraries.git] / Makefile
1
2 #
3 # libpnd Makefile
4 #
5
6 # tools
7 CC = gcc
8 AR = ar
9 RANLIB = ranlib
10 RM = rm
11
12 # environment
13 VPATH = lib test apps
14 CFLAG_SO = -fPIC #-fPIC not always needed, but good to have
15 CFLAGS = -Wall -I./include -g ${CFLAG_SO}
16 CXXFLAGS = -Wall -I./include -g ${CFLAG_SO}
17
18 # code
19 LIB = libpnd.a 
20 SOLIB = libpnd.so.1         # canonicle name
21 SOLIB1 = libpnd.so.1.0.1    # versioned name
22 XMLOBJ = lib/tinyxml/tinystr.o lib/tinyxml/tinyxml.o lib/tinyxml/tinyxmlerror.o lib/tinyxml/tinyxmlparser.o
23 ALLOBJ = pnd_conf.o pnd_container.o pnd_discovery.o pnd_pxml.o pnd_notify.o pnd_locate.o pnd_tinyxml.o pnd_pndfiles.o pnd_apps.o pnd_utility.o
24
25 all: ${SOLIB} ${LIB} conftest discotest notifytest locatetest pndnotifyd
26
27 clean:
28         ${RM} -f ${ALLOBJ} ${XMLOBJ} ${LIB} ${SOLIB1} locatetest.o bin/locatetest conftest.o bin/conftest discotest.o bin/discotest bin/notifytest notifytest.o bin/pndnotifyd pndnotifyd.o ${SOLIB} testdata/dotdesktop/*.desktop testdata/apps/*.pnd testdata/dotdesktop/*.png deployment/usr/lib/libpnd* deployment/usr/bin/pndnotifyd deployment/usr/pandora/scripts/* deployment/etc/sudoers deployment/etc/init.d/pndnotifyd
29         ${RM} -rf deployment/media
30         find . -name "*~*" -exec rm {} \; -print
31
32 # component targets
33 #
34
35 libpnd.a:       ${ALLOBJ} ${XMLOBJ}
36         ${AR} r ${LIB} ${ALLOBJ} ${XMLOBJ}
37         ${RANLIB} ${LIB}
38
39 libpnd.so.1:    ${ALLOBJ} ${XMLOBJ}
40         ${CC} -shared -Wl,-soname,${SOLIB} -o ${SOLIB1} ${ALLOBJ} ${XMLOBJ}
41         ln -f -s ${SOLIB1} ${SOLIB}
42
43 pndnotifyd:     pndnotifyd.o ${SOLIB1}
44         ${CC} -lstdc++ -o bin/pndnotifyd pndnotifyd.o ${SOLIB1}
45
46 # deployment and assembly components
47 #
48
49 pnd:
50         # build x86_ls with icon
51         cd testdata/pndsample; ../scripts/pnd_make.sh -p x86_ls.pnd -d x86_ls -i x86_ls/zeldaicon.png -x x86_ls/PXML.xml
52         # build x86_echo with no icon
53         cd testdata/pndsample; ../scripts/pnd_make.sh -p x86_echo.pnd -d x86_echo -x x86_echo/PXML.xml
54
55 deploy: 
56         # populate deployment directory for copying into image bakes
57         # make dirs
58         mkdir -p deployment/etc/pandora/conf
59         mkdir -p deployment/usr/lib
60         mkdir -p deployment/usr/bin
61         mkdir -p deployment/usr/pandora/apps
62         mkdir -p deployment/usr/pandora/scripts
63         mkdir -p deployment/etc/init.d/
64         # premake the directories that SD's mount onto; makes pndnotifyd life easier
65         mkdir -p deployment/media/mmcblk0p1
66         mkdir -p deployment/media/mmcblk1p1
67         # copy in goodies
68         cp libpnd* deployment/usr/lib
69         cp bin/pndnotifyd deployment/usr/bin
70         cp testdata/scripts/* deployment/usr/pandora/scripts
71         # copy in freebee .pnd apps to /usr/pandora/apps
72         # add pndnotify to etc/rc/startup-whatever
73         cp testdata/sh/pndnotifyd deployment/etc/init.d/pndnotifyd
74         cp testdata/sh/sudoers deployment/etc/sudoers
75
76 # test tool targets
77 #
78
79 conftest:       conftest.o ${LIB}
80         ${CC} -lstdc++ -o bin/conftest conftest.o libpnd.a
81
82 discotest:      discotest.o ${LIB}
83         ${CC} -lstdc++ -o bin/discotest discotest.o libpnd.a
84
85 notifytest:     notifytest.o ${LIB}
86         ${CC} -lstdc++ -o bin/notifytest notifytest.o libpnd.a
87
88 locatetest:     locatetest.o ${SOLIB1}
89         ${CC} -lstdc++ -o bin/locatetest locatetest.o ${SOLIB1}