Skip to content

Commit

Permalink
snapshot of KB3CS offline radioberry repo - loadgateware successfully…
Browse files Browse the repository at this point in the history
… programs FPGA on raspberry pi 5
  • Loading branch information
csylvain committed May 8, 2024
1 parent 517ae18 commit a4f2213
Show file tree
Hide file tree
Showing 10 changed files with 3,855 additions and 22 deletions.
46 changes: 35 additions & 11 deletions SBC/rpi-5/utility/gatewareloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@ ifneq ($V,1)
Q ?= @
endif

#DEBUG = -g -O0
DEBUG = -O3
DEBUG = -g -O0
#DEBUG = -O3
CC = gcc
INCLUDE = -I/usr/local/include
CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
INCLUDE = -I/usr/local/include
CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe

LDFLAGS = -L/usr/local/lib
LDLIBS = -lpthread -lm
LDFLAGS = -L/usr/local/lib
LDLIBS = -lpthread -lm -lgpiod

SRC = loadFPGA.c
SRC = loadFPGA.c loadgateware.c

OBJ = $(SRC:.c=.o)

BINS = $(SRC:.c=)

all:
$Q cat README.TXT
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
#cur_mkfile := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
dir_path := $(shell dirname $(mkfile_path))

all:
$Q cat README
$Q echo " $(BINS)" | fmt
$Q echo ""

Expand All @@ -27,7 +31,27 @@ really-all: $(BINS)
loadFPGA: loadFPGA.o
$Q echo [link]
$Q $(CC) -o $@ loadFPGA.o $(LDFLAGS) $(LDLIBS)


loadgateware.o: loadgateware.c
$Q echo [CC] $<
$Q $(CC) -c $(DEBUG) -Wall -I. -Winline -pipe $< -o $@

loadgateware: loadgateware.o
$Q echo [link] [$(dir_path)]
$Q $(CC) -o $@ loadgateware.o -lpthread -lm -l:libgpiod.so.2

toggle-pin24.o: toggle-pin24.c
$Q echo [CC] $<
$Q $(CC) -c $(DEBUG) -Wall -I. -Winline -pipe $< -o $@

toggle-pin24: toggle-pin24.o
$Q echo [link] [$(dir_path)]
$Q $(CC) -o $@ toggle-pin24.o -lpthread -lm -l:libgpiod.so.2

loadgateware3: loadgateware3.o
$Q echo [link]
$Q $(CC) -o $@ loadgateware3.o $(LDFLAGS) $(LDLIBS)

.c.o:
$Q echo [CC] $<
$Q $(CC) -c $(CFLAGS) $< -o $@
Expand All @@ -41,4 +65,4 @@ tags: $(SRC)
$Q ctags $(SRC)

depend:
makedepend -Y $(SRC)
makedepend -Y $(SRC)
Loading

0 comments on commit a4f2213

Please sign in to comment.