https://github.com/jrincayc/ucblogo-code
Tip revision: e023b8fcadc2e1b35a37b911250b251e0ec1da0b authored by Joshua Cogliati on 31 December 2020, 15:53:53 UTC
Merge pull request #87 from jrincayc/update_version
Merge pull request #87 from jrincayc/update_version
Tip revision: e023b8f
makefile.msys
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.0.5
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) -lwxmsw30u_richtext -lwxmsw30u_aui -lwxmsw30u_html -lwxmsw30u_adv -lwxmsw30u_core -lwxbase30u_net -lwxbase30u -lwxregexu -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
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 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 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/.
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