-
Notifications
You must be signed in to change notification settings - Fork 34
/
makefile.msys
114 lines (94 loc) · 4.16 KB
/
makefile.msys
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
CC = gcc
CFLAGS = -g -O -DHAVE_CONFIG_H -DHAVE_WX -DX_DISPLAY_MISSING -O0
CXX = g++
MINGW_BIN_DIR = /mingw/bin
WX_DIR = $(HOME)/wxWidgets-3.2.2.1
CXXFLAGS = -DHAVE_CONFIG_H -DHAVE_WX -I$(WX_DIR)/include -I$(WX_DIR)/lib/gcc_lib/mswu -D__WXDEBUG__ -D__WXMSW__ -mthreads
LDFLAGS = -mwindows
WX_LIB_LOC = $(WX_DIR)/lib/gcc_lib/
LIBS = -lm -L/usr/local/lib -mwindows -mthreads -mwindows -Wl,--subsystem,windows -mwindows -L$(WX_LIB_LOC) -lwxmsw32u_richtext -lwxmsw32u_aui -lwxmsw32u_html -lwxmsw32u_adv -lwxmsw32u_core -lwxbase32u_net -lwxbase32u -lwxregexu -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -lversion -lshlwapi -luxtheme -loleacc
prefix = /c/ucblogo
BINDIR = $(prefix)/bin
LIBLOC = $(prefix)/lib/logo
LINKER = $(CXX)
# LIBLOC = `pwd`
OBJS = coms.o error.o eval.o files.o graphics.o init.o intern.o \
libloc.o lists.o logodata.o main.o math.o mem.o paren.o parse.o \
print.o wrksp.o nographics.o git.o wxMain.o wxTerminal.o \
wxCommandHistory.o wxTurtleGraphics.o TextEditor.o wxterm.o
SRCS = coms.c error.c eval.c files.c graphics.c init.c intern.c config.h \
libloc.c lists.c logodata.c main.c math.c mem.c paren.c parse.c \
print.c wrksp.c nographics.c wxMain.cpp wxTerminal.cpp \
wxCommandHistory.cpp wxTurtleGraphics.cpp TextEditor.cpp wxterm.c
HDRS = globals.h logo.h xgraphics.h
all: logo.exe
mem.o: mem.c
$(CC) $(CFLAGS) -O0 -c mem.c
logo.exe: $(OBJS)
windres logo_win.rc -O coff -o logo_win.res
$(LINKER) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) logo_win.res -o logo.exe
git.c: $(SRCS)
echo 'char* GIT = "('`git describe||echo NA|tr -d '\r'`')";' > git.c
config.h: config.h.msys
cp config.h.msys config.h
tags: $(SRCS)
ctags --format=1 -N $(SRCS) $(HDRS)
# ctags -t $(SRCS) $(HDRS)
libloc.c:
echo 'char *libloc="'$(LIBLOC)'/logolib";' > libloc.c
echo 'char *helploc="'$(LIBLOC)'/helpfiles";' >> libloc.c
echo 'char *cslsloc="'$(LIBLOC)'/csls";' >> libloc.c
echo 'char *temploc="/tmp";' >> libloc.c
echo 'char *separator="/";' >> libloc.c
helpfiles:
mkdir helpfiles
helpfiles/HELPCONTENTS: makehelp usermanual
./makehelp
sort helptemp | pr -5 -t -w80 >> helpfiles/HELPCONTENTS
rm helptemp
makehelp: makehelp.c
$(CC) -o makehelp makehelp.c
clean:
rm -f *.o libloc.c
rm -Rf UCBLogo/
ship:
rm -f config.h config.cache config.log config.status
rm -f makefile makehelp logo *.o libloc.c
cd docs; $(MAKE) ship
install_win: all
for d in $(BINDIR) $(LIBLOC) $(LIBLOC)/logolib $(LIBLOC)/helpfiles $(LIBLOC)/csls $(LIBLOC)/source; do [ -d $$d ] || mkdir -p $$d || exit 1; done
cp logo.exe $(BINDIR)/ucblogo.exe
cp $(MINGW_BIN_DIR)/libgcc_s_dw2-1.dll $(MINGW_BIN_DIR)/libstdc++-6.dll $(MINGW_BIN_DIR)/libwinpthread-1.dll $(BINDIR)/
cp -f logolib/* $(LIBLOC)/logolib/.
mv -v $(LIBLOC)/logolib/RENAME-GRAVE-ACCENT '$(LIBLOC)/logolib/`'
mv -v $(LIBLOC)/logolib/RENAME-NUMBER-SIGN '$(LIBLOC)/logolib/#'
cp -f helpfiles/* $(LIBLOC)/helpfiles/.
cp -f csls/* $(LIBLOC)/csls/.
cp -f LICENSE $(LIBLOC)/
cp -f README.md $(LIBLOC)/README.txt
cp -f *.[ch]* makefile.msys ucblogo.xpm logo_win.rc logologo.ico docs/ucblogo.texi $(LIBLOC)/source/
cp -f docs/ucblogo.pdf $(LIBLOC)/
#(cd docs; prefix=$(prefix) LIBLOC=$(LIBLOC) BINDIR=$(BINDIR) $(MAKE) install)
# prefix=$(prefix); LIBLOC=$(LIBLOC); BINDIR=$(BINDIR); export prefix LIBLOC BINDIR; cd emacs; $(MAKE) install
make-docs:
(cd docs; prefix=$(prefix) LIBLOC=$(LIBLOC) $(MAKE) all)
ucblogo.zip : logo.exe
mkdir -p UCBLogo
cp logo.exe UCBLogo/
cp -a logolib UCBLogo/
cp /mingw/bin/libgcc_s_dw2-1.dll /mingw/bin/libstdc++-6.dll UCBLogo/
zip -r ucblogo.zip UCBLogo
#Note, to figure out which dlls are needed, use:
# objdump.exe -x logo.exe | grep -i 'DLL Name'
mac: all
mkdir -p UCBLogo.app
mkdir -p UCBLogo.app/Contents
cp Info.plist UCBLogo.app/Contents/
cp PkgInfo UCBLogo.app/Contents/
cp pbdevelopment.plist UCBLogo.app/Contents/
mkdir -p UCBLogo.app/Contents/Resources
cp -r csls UCBLogo.app/Contents/Resources/
cp -r helpfiles UCBLogo.app/Contents/Resources/
cp -r logolib UCBLogo.app/Contents/Resources/
mkdir -p UCBLogo.app/Contents/MacOS/
cp logo UCBLogo.app/Contents/MacOS/UCBLogo