Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added makefile and instructions for building on Raspberry Pi #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions Makefile.rpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# For GNU make
CC = cc
LD = cc
AR = ar
RANLIB = ranlib
RM = rm -f
CP = cp

DEBUG = -O2
#DEBUG = -g
CFLAGS = -Wall -marm -march=armv6 -mfloat-abi=hard -mfpu=vfp
IPATH = -Ishapelib
LDFLAGS = -s
#LDFLAGS =
LPATH =
LIBS = -lm -lrt

TGTS = gk-slo gk-shp
WOBJS = wgk-slo.o wutil.o wgeo.o
OBJS = gk-shp.o util.o geo.o
INCL = common.h geo.h geoid_slo.h geoid_egm.h aft_gktm.h aft_tmgk.h
SHPOBJS = shapelib/shpopen.o shapelib/dbfopen.o shapelib/safileio.o shapelib/shptree.o
SHPINCL = shapelib/shapefil.h

all: $(TGTS)

gk-slo: $(WOBJS)
$(LD) -o $@ $(WOBJS) $(LDFLAGS) $(LPATH) $(LIBS)

gk-shp: $(OBJS) $(SHPOBJS)
$(LD) -o $@ $(OBJS) $(SHPOBJS) $(LDFLAGS) $(LPATH) $(LIBS)

$(OBJS): $(INCL)
$(WOBJS): $(INCL)
$(SHPOBJS): $(SHPINCL)

test: $(TGTS)
./gk-slo -x > gk-slo.tmp
diff gk-slo.tmp refout-slo.txt
./gk-slo -x -g egm > gk-slo.tmp
diff gk-slo.tmp refout-egm.txt
@$(RM) gk-slo.tmp

install: $(TGTS)
@echo Copy gk-slo and gk-shp to a directory of your choice

clean:
-$(RM) $(OBJS) $(WOBJS) $(SHPOBJS)
cleanall: clean
-$(RM) $(TGTS)

wgk-slo.o: gk-slo.c
$(CC) $(DEBUG) -c $(CFLAGS) -D_WCHAR $(IPATH) gk-slo.c -o $@
wutil.o: util.c
$(CC) $(DEBUG) -c $(CFLAGS) -D_WCHAR $(IPATH) util.c -o $@
wgeo.o: geo.c
$(CC) $(DEBUG) -c $(CFLAGS) -D_WCHAR $(IPATH) geo.c -o $@
.c.o:
$(CC) $(DEBUG) -c $(CFLAGS) $(IPATH) $< -o $@
6 changes: 6 additions & 0 deletions PREBERIME.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ Ng = geoidna višina
&nbsp;&nbsp;&nbsp;```shapelib\shpopen.c shapelib\dbfopen.c shapelib\safileio.c shapelib\shptree.c -o gk-shp -lm -rt```
ali
```$ make -f Makefile.unix```
#### Unix (Ubuntu) na Raspberry Pi
```$ cc -O2 -Wall -marm -march=armv6 -mfloat-abi=hard -mfpu=vfp gk-slo.c util.c geo.c -o gk-slo -lm -lrt```
```$ cc -O2 -Wall -marm -march=armv6 -mfloat-abi=hard -mfpu=vfp -Ishapelib gk-shp.c util.c geo.c \ ```
&nbsp;&nbsp;&nbsp;```shapelib\shpopen.c shapelib\dbfopen.c shapelib\safileio.c shapelib\shptree.c -o gk-shp -lm -rt```
ali
```$ make -f Makefile.rpi```
#### MinGW na Windows
```$ gcc -O2 -Wall -msse2 -mfpmath=sse -D_WCHAR gk-slo.c util.c geo.c -o gk-slo.exe```
```$ gcc -O2 -Wall -msse2 -mfpmath=sse -Ishapelib gk-shp.c util.c geo.c \ ```
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ Ng = geoid height
&nbsp;&nbsp;&nbsp;```shapelib\shpopen.c shapelib\dbfopen.c shapelib\safileio.c shapelib\shptree.c -o gk-shp -lm -rt```
or
```$ make -f Makefile.unix```
#### Unix (Ubuntu) on Raspberry Pi
```$ cc -O2 -Wall -marm -march=armv6 -mfloat-abi=hard -mfpu=vfp gk-slo.c util.c geo.c -o gk-slo -lm -lrt```
```$ cc -O2 -Wall -marm -march=armv6 -mfloat-abi=hard -mfpu=vfp -Ishapelib gk-shp.c util.c geo.c \ ```
&nbsp;&nbsp;&nbsp;```shapelib\shpopen.c shapelib\dbfopen.c shapelib\safileio.c shapelib\shptree.c -o gk-shp -lm -rt```
or
```$ make -f Makefile.rpi```
#### MinGW on Windows
```$ gcc -O2 -Wall -msse2 -mfpmath=sse -D_WCHAR gk-slo.c util.c geo.c -o gk-slo.exe```
```$ gcc -O2 -Wall -msse2 -mfpmath=sse -Ishapelib gk-shp.c util.c geo.c \ ```
Expand Down