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
|
DESTDIR =
FPC_VERSION = $(shell update-alternatives --list lazarus | tail -1 | awk -F / '{print $$5}')
ARCH = $(shell ls /usr/lib/lazarus/$(FPC_VERSION)/lcl/units/*/forms.ppu | awk -F/ '{print $$8}')
UNITLIBS = -Fu/usr/lib/lazarus/$(FPC_VERSION)/lcl/units/$(ARCH)/
UNITLIBS += -Fu/usr/lib/lazarus/$(FPC_VERSION)/lcl/units/$(ARCH)/gtk2/
UNITLIBS += -Fu/usr/lib/lazarus/$(FPC_VERSION)/components/lazutils/lib/$(ARCH)/
UNITLIBS += -Fu/usr/lib/lazarus/$(FPC_VERSION)/packager/units/$(ARCH)/
UNITLIBS += -Fu/usr/lib/lazarus/$(FPC_VERSION)/components/printers/lib/$(ARCH)/gtk2/
UNITLIBS += -Fu/usr/lib/lazarus/$(FPC_VERSION)/components/synedit/units/$(ARCH)/
UNITLIBS += -Fu/usr/lib/lazarus/$(FPC_VERSION)/components/cairocanvas/lib/$(ARCH)/gtk2/
UNITLIBS += -Fu.
TARGET = -TLINUX
MODE = -MObjFPC
SWITCHES = -Scgi #C-style operators, label and goto, C++ style INLINE.
OPTIM = -O1
DEBUG = -gl
VERBOSE = -vewnhi
LOGO = -l
INCPATH = -Fi/
DEFINES = -dLCL -dLCLgtk2
# lrs files to let without recompilation
RESERVED_LRS = curseurs.lrs optgeo.lrs
all: optgeo
optgeo: optgeo.lpr lrsFiles
fpc -B $(MODE) $(SWITCHES) $(OPTIM) $(DEBUG) $(VERBOSE) $(LOGO) $(INCPATH) $(UNITLIBS) $(DEFINES) $(TARGET) -o$@ $<
lrsFiles:
#make file comparisons case-insensitive
shopt -s nocasematch; \
for f in $(shell ls *.pas); do \
g=$$(echo $$f | sed 's/.pas/.lfm/'); \
if ls *.lfm | grep -q $$g; then continue; fi; \
if echo $(RESERVED_LRS)| grep -q $$f; then continue; fi; \
lazres $$(echo $$f| sed 's/\..*/.lrs/') $$f; \
done
for f in $(shell ls *.lfm); do \
echo $(RESERVED_LRS)| grep -q $$f || lazres $$(echo $$f| sed 's/\..*/.lrs/') $$f; \
done
clean:
rm -f *~ *.o *.ppu *.res *.manifest *.rc *.rst *.or
rm -f *.lpi *.rsj *.compiled
# remove generated lrs files
for f in $(shell ls *.lrs); do \
echo $(RESERVED_LRS)| grep -q $$f || rm -f $$f; \
done
rm -f optgeo
install: all
install -d $(DESTDIR)/usr/bin
install -m 755 optgeo $(DESTDIR)/usr/bin
install -d $(DESTDIR)/usr/share/optgeo
cp -a exemples $(DESTDIR)/usr/share/optgeo
cp -a lang $(DESTDIR)/usr/share/optgeo
cp -a aide $(DESTDIR)/usr/share/optgeo
cp listen.lst $(DESTDIR)/usr/share/optgeo
find $(DESTDIR)/usr/share/optgeo -type f -exec chmod 644 {} \;
install -d $(DESTDIR)/usr/share/pixmaps
rsvg-convert -w 48 optgeo.svg -o $(DESTDIR)/usr/share/pixmaps/optgeo-48.png
install -d $(DESTDIR)/usr/share/applications
install -m 644 optgeo.desktop $(DESTDIR)/usr/share/applications
.PHONY: all clean install lrsFiles
|