Update to purify v02r01 release.
[bsnes:bsnes.git] / purify / Makefile
1 include nall/Makefile
2 include phoenix/Makefile
3
4 path := /usr/local/bin
5 flags := -I. -O3 -fomit-frame-pointer
6 link := -s
7 objects := obj/phoenix.o obj/purify.o
8
9 ifeq ($(platform),x)
10   link += -Wl,-export-dynamic
11 else ifeq ($(platform),win)
12   link += -mwindows
13 endif
14
15 all: build;
16
17 obj/phoenix.o: phoenix/phoenix.cpp
18         $(cpp) $(flags) -o obj/phoenix.o -c phoenix/phoenix.cpp $(phoenixflags)
19
20 obj/purify.o: purify.cpp
21         $(cpp) $(flags) -o obj/purify.o -c purify.cpp
22
23 build: $(objects)
24 ifeq ($(platform),x)
25         $(cpp) $(link) -o purify $(objects) $(phoenixlink)
26 else ifeq ($(platform),win)
27         windres phoenix/windows/phoenix.rc obj/phoenix-resource.o
28         $(cpp) -shared -o phoenix.dll obj/phoenix.o $(phoenixlink)
29         $(cpp) -o purify obj/purify.o obj/phoenix-resource.o $(link) -L. -lphoenix
30 endif
31
32 resource: force
33         sourcery resource/resource.bml resource/resource.cpp resource/resource.hpp
34
35 clean:
36         -@$(call delete,obj/*.o)
37
38 install: uninstall
39 ifeq ($(platform),x)
40         sudo cp ./purify $(path)/purify
41 endif
42
43 uninstall:
44 ifeq ($(platform),x)
45         if [ -f $(path)/purify ]; then sudo rm $(path)/purify; fi
46 endif
47
48 sync:
49 ifeq ($(shell id -un),byuu)
50         if [ -d ./nall ]; then rm -r ./nall; fi
51         if [ -d ./phoenix ]; then rm -r ./phoenix; fi
52         cp -r ../nall ./nall
53         cp -r ../phoenix ./phoenix
54         rm -r nall/test
55         rm -r phoenix/nall
56         rm -r phoenix/test
57 endif
58
59 force: