forked from TroikaTronix/firmata_test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (57 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#OS = LINUX
OS = MACOSX
#OS = WINDOWS
PROG = firmata_test
ifeq ($(OS), LINUX)
TARGET = $(PROG)
FINAL_TARGET = $(TARGET)
CXX = g++
STRIP = strip
WXCONFIG = ~/wxwidgets/2.8.10.gtk2.teensy/bin/wx-config
CPPFLAGS = -O2 -Wall -Wno-strict-aliasing `$(WXCONFIG) --cppflags` -D$(OS)
LIBS = `$(WXCONFIG) --libs`
else ifeq ($(OS), MACOSX)
TARGET = $(PROG)
FINAL_TARGET = $(PROG).dmg
CXX = g++
STRIP = strip
WXCONFIG = wx-config
CPPFLAGS = -O2 -Wall -Wno-strict-aliasing `$(WXCONFIG) --cppflags` -D$(OS)
LIBS = `$(WXCONFIG) --libs`
else ifeq ($(OS), WINDOWS)
TARGET = $(PROG).exe
FINAL_TARGET = $(TARGET)
CXX = i586-mingw32msvc-g++
STRIP = i586-mingw32msvc-strip
WINDRES = i586-mingw32msvc-windres
KEY_SPC = ~/bin/cert/mykey.spc
KEY_PVK = ~/bin/cert/mykey.pvk
KEY_TS = http://timestamp.comodoca.com/authenticode
WXCONFIG = ~/wxwidgets/2.8.10.mingw.teensy/bin/wx-config
CPPFLAGS = -O2 -Wall -Wno-strict-aliasing `$(WXCONFIG) --cppflags` -D$(OS)
LIBS = `$(WXCONFIG) --libs`
endif
MAKEFLAGS = --jobs=4
OBJS = firmata_test.o serial.o
all: $(FINAL_TARGET)
$(PROG): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LIBS)
$(PROG).exe: $(PROG)
cp $(PROG) $@
-upx -q $@
-signcode -spc $(KEY_SPC) -v $(KEY_PVK) -t $(KEY_TS) $@
-cp_win32.sh $@
$(PROG).app: $(PROG) Info.plist
mkdir -p $(PROG).app/Contents/MacOS
mkdir -p $(PROG).app/Contents/Resources/English.lproj
cp Info.plist $(PROG).app/Contents/Info.plist
/bin/echo -n 'APPL????' > $(PROG).app/Contents/PkgInfo
cp $(PROG) $(PROG).app/Contents/MacOS/
touch $(PROG).app
$(PROG).dmg: $(PROG).app
mkdir dmg_tmpdir
cp -r $(PROG).app dmg_tmpdir
hdiutil create -ov -srcfolder dmg_tmpdir -format UDBZ -volname "Firmata Test" $(PROG).dmg
clean:
rm -f $(PROG) $(PROG).exe $(PROG).exe.bak $(PROG).dmg *.o
rm -rf $(PROG).app dmg_tmpdir