Raw File
Tip revision: 9193bdc5ad3c6a6332421f14021317b66dcb9618 authored by Joshua J. Cogliati on 14 December 2020, 03:39 UTC
Bumping version to 6.2 (and 6.2pre in
Tip revision: 9193bdc
CC	= gcc
CXX     = g++
CXXFLAGS =  -DHAVE_WX -I$(HOME)/wxWidgets-3.0.4/include -I$(HOME)/wxWidgets-3.0.4/lib/gcc_lib/mswu -D__WXDEBUG__ -D__WXMSW__ -mthreads
LDFLAGS	=   -mwindows
WX_LIB_LOC = $(HOME)/wxWidgets-3.0.4/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 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
prefix = /c/ucblogo
BINDIR        = $(prefix)/bin
LIBLOC        = $(prefix)/lib/logo

# 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 logolib/Messages helpfiles helpfiles/HELPCONTENTS

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)

	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

logolib/Messages:	makelib Messages
	chmod +x makelib
	cp -f Messages logolib

	mkdir helpfiles

helpfiles/HELPCONTENTS:	makehelp usermanual
	sort helptemp | pr -5 -t -w80 >> helpfiles/HELPCONTENTS
	rm helptemp

makehelp:	makehelp.c
	$(CC) -o makehelp makehelp.c

	rm -f *.o libloc.c
	rm -Rf UCBLogo/

	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/libgcc_s_dw2-1.dll /mingw/bin/libstdc++-6.dll $(BINDIR)/
	cp -f logolib/* $(LIBLOC)/logolib/.
	cp -f helpfiles/* $(LIBLOC)/helpfiles/.
	cp -f csls/* $(LIBLOC)/csls/.
	cp -f $(LIBLOC)/README.txt
	cp -f *.[ch]* makefile.msys ucblogo.xpm logo_win.rc logologo.ico makelib Messages docs/usermanual.texi $(LIBLOC)/source/
	cp -f docs/usermanual.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

	(cd docs; prefix=$(prefix) LIBLOC=$(LIBLOC) $(MAKE) all) : 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
#Note, to figure out which dlls are needed, use:
#  objdump.exe -x logo.exe | grep -i 'DLL Name'

mac: all
	mkdir -p
	mkdir -p
	cp Info.plist
	cp PkgInfo
	cp pbdevelopment.plist
	mkdir -p
	cp -r csls
	cp -r helpfiles
	cp -r logolib
	mkdir -p
	cp logo
back to top