Fix even more leaks
[pandora-libraries.git] / Makefile
1
2 #
3 # libpnd Makefile
4 #
5
6 # tools
7 CC = ${CROSSCOMPILE}gcc
8 CXX = ${CROSSCOMPILE}g++
9 AR = ${CROSSCOMPILE}ar
10 RANLIB = ${CROSSCOMPILE}ranlib
11 RM = rm
12
13 # environment
14 VPATH = lib test apps minimenu
15 CFLAG_SO = -fPIC #-fPIC not always needed, but good to have
16 CFLAGS = -Wall -I./include -g ${CFLAG_SO} -I${PNDSTUFF}/usr/include/SDL
17 CXXFLAGS = -Wall -I./include -g ${CFLAG_SO}
18
19 # code
20 LIB = libpnd.a 
21 SOLIB = libpnd.so.1         # canonicle name
22 SOLIB1 = libpnd.so.1.0.1    # versioned name
23 XMLOBJ = lib/tinyxml/tinystr.o lib/tinyxml/tinyxml.o lib/tinyxml/tinyxmlerror.o lib/tinyxml/tinyxmlparser.o
24 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 pnd_desktop.o pnd_io_gpio.o pnd_io_ioctl.o pnd_io_evdev.o pnd_logger.o pnd_dbusnotify.o pnd_device.o
25
26 all: ${SOLIB} ${LIB} conftest discotest evdevtest notifytest pndnotifyd rawpxmltest pndvalidator loggertest dbusnotifytest pnd_run pndevmapperd pnd_info evtest mmenu mmwrapper
27
28 clean:
29         ${RM} -f ${ALLOBJ} ${XMLOBJ} ${LIB} ${SOLIB1} locatetest.o bin/locatetest conftest.o bin/conftest discotest.o evdevtest.o bin/evdevtest bin/discotest dbusnotifytest.o bin/dbusnotifytest loggertest.o bin/loggertest bin/notifytest notifytest.o bin/rawpxmltest rawpxmltest.o bin/pnd_run pnd_run.o pnd_info.o bin/pnd_info bin/pndevmapperd pndevmapperd.o bin/pndnotifyd pndnotifyd.o ${SOLIB} testdata/dotdesktop/*.desktop testdata/menu/*.desktop testdata/apps/*.ovr testdata/apps/*.pnd testdata/dotdesktop/*.png deployment/usr/lib/libpnd* deployment/usr/bin/pndnotifyd deployment/usr/bin/pnd_run deployment/usr/bin/pnd_info deployment/usr/pandora/scripts/* deployment/etc/sudoers deployment/etc/init.d/pndnotifyd bin/pndvalidator pndvalidator.o deployment/usr/bin/pndevmapperd testdata/menuicons/* evtest.o bin/evtest bin/mmenu bin/mmwrapper mmenu.o mmwrapper.o deployment/usr/bin/mmenu deployment/usr/bin/mmwrapper mmcache.o mmui.o mmcat.o mmconf.o freedsktop_cats.o freedesktop_cats.o mmcustom_cats.o
30         ${RM} -rf deployment/media deployment/etc/pandora/mmenu
31         find . -name "*~*" -exec rm {} \; -print
32
33 # component targets
34 #
35
36 libpnd.a:       ${ALLOBJ} ${XMLOBJ}
37         ${AR} r ${LIB} ${ALLOBJ} ${XMLOBJ}
38         ${RANLIB} ${LIB}
39
40 libpnd.so.1:    ${ALLOBJ} ${XMLOBJ}
41         ${CC} -shared -Wl,-soname,${SOLIB} -o ${SOLIB1} ${ALLOBJ} ${XMLOBJ}
42         ln -f -s ${SOLIB1} ${SOLIB}
43
44 ${SOLIB1}:      ${ALLOBJ} ${XMLOBJ}
45         ${CC} -shared -Wl,-soname,${SOLIB} -o ${SOLIB1} ${ALLOBJ} ${XMLOBJ}
46         ln -f -s ${SOLIB1} ${SOLIB}
47
48 pndnotifyd:     pndnotifyd.o ${SOLIB1}
49         ${CC} -lstdc++ -o bin/pndnotifyd pndnotifyd.o ${SOLIB1}
50
51 pndvalidator:   pndvalidator.o ${SOLIB1}
52         ${CC} -lstdc++ -o bin/pndvalidator pndvalidator.o ${SOLIB1}
53
54 pnd_run:        pnd_run.o ${SOLIB1}
55         ${CC} -lstdc++ -o bin/pnd_run pnd_run.o ${SOLIB1}
56
57 pnd_info:       pnd_info.o ${SOLIB1}
58         ${CC} -lstdc++ -o bin/pnd_info pnd_info.o ${SOLIB1}
59
60 pndevmapperd:   pndevmapperd.o ${SOLIB1}
61         ${CC} -lstdc++ -o bin/pndevmapperd pndevmapperd.o ${SOLIB1}
62
63 mmenu:  mmenu.o mmui.o mmcache.o mmcat.o mmconf.o freedesktop_cats.o mmcustom_cats.o ${SOLIB1}
64         ${CC} -lstdc++ -o bin/mmenu mmenu.o mmui.o mmcache.o mmcat.o mmconf.o freedesktop_cats.o mmcustom_cats.o ${SOLIB1} -L${PNDSTUFF}/usr/lib -lSDL -lSDL_image -lSDL_ttf -lSDL_gfx
65 mmwrapper:      mmwrapper.o ${SOLIB1}
66         ${CC} -lstdc++ -o bin/mmwrapper mmwrapper.o ${SOLIB1}
67
68 # deployment and assembly components
69 #
70
71 pnd:
72         # build x86_ls with icon
73         cd testdata/pndsample; ../scripts/pnd_make.sh -p x86_ls.pnd -d x86_ls -i x86_ls/zeldaicon.png -x x86_ls/PXML.xml
74         # build x86_echo with no icon
75         cd testdata/pndsample; ../scripts/pnd_make.sh -p x86_echo.pnd -d x86_echo -x x86_echo/PXML.xml
76
77 deploy: 
78         # populate deployment directory for copying into image bakes
79         # make dirs
80         mkdir -p deployment/etc/pandora/conf
81         mkdir -p deployment/etc/pandora/mmenu/skins/default
82         mkdir -p deployment/etc/pandora/mmenu/skins/perty
83         mkdir -p deployment/usr/lib
84         mkdir -p deployment/usr/bin
85         mkdir -p deployment/usr/pandora/apps
86         mkdir -p deployment/usr/pandora/scripts
87         mkdir -p deployment/etc/init.d/
88         # premake the directories that SD's mount onto; makes pndnotifyd life easier
89         mkdir -p deployment/media/mmcblk0p1
90         mkdir -p deployment/media/mmcblk1p1
91         # copy in goodies
92         cp libpnd* deployment/usr/lib
93         cp bin/pndnotifyd deployment/usr/bin
94         cp bin/pnd_run deployment/usr/bin
95         cp bin/pnd_info deployment/usr/bin
96         cp testdata/scripts/* deployment/usr/pandora/scripts
97         cp bin/pndevmapperd deployment/usr/bin
98         cp bin/mmenu deployment/usr/bin
99         cp bin/mmwrapper deployment/usr/bin
100         # copy in freebee .pnd apps to /usr/pandora/apps
101         # add pndnotify to etc/rc/startup-whatever
102         cp testdata/sh/pndnotifyd deployment/etc/init.d/pndnotifyd
103         cp testdata/sh/sudoers deployment/etc/sudoers
104         # minimenu
105         cp bin/mmenu deployment/usr/bin
106         cp bin/mmwrapper deployment/usr/bin
107         cp minimenu/skin/default/* deployment/etc/pandora/mmenu/skins/default
108         cp minimenu/skin/perty/* deployment/etc/pandora/mmenu/skins/perty
109
110 # test tool targets
111 #
112
113 conftest:       conftest.o ${LIB}
114         ${CC} -lstdc++ -o bin/conftest conftest.o libpnd.a
115
116 discotest:      discotest.o ${LIB}
117         ${CC} -lstdc++ -o bin/discotest discotest.o libpnd.a
118
119 evdevtest:      evdevtest.o ${LIB}
120         ${CC} -lstdc++ -o bin/evdevtest evdevtest.o -static libpnd.a
121
122 notifytest:     notifytest.o ${LIB}
123         ${CC} -lstdc++ -o bin/notifytest notifytest.o libpnd.a
124
125 locatetest:     locatetest.o ${SOLIB1}
126         ${CC} -lstdc++ -o bin/locatetest locatetest.o ${SOLIB1}
127
128 rawpxmltest:    rawpxmltest.o ${LIB}
129         ${CC} -lstdc++ -o bin/rawpxmltest rawpxmltest.o ${LIB}
130
131 loggertest:     loggertest.o ${LIB}
132         ${CC} -lstdc++ -o bin/loggertest loggertest.o libpnd.a
133
134 dbusnotifytest: dbusnotifytest.o ${LIB}
135         ${CC} -lstdc++ -o bin/dbusnotifytest dbusnotifytest.o libpnd.a
136
137 evtest: evtest.o
138         ${CC} -o bin/evtest evtest.o