Skip to content

Commit

Permalink
Create /bin/kcpfpg symlink on kcpfpg install
Browse files Browse the repository at this point in the history
tcpborphserver3 relies upon the kcpfpg utility being available as
`/bin/kcpfpg`, but the kcpfpg Makefile installs it into `$(PREFIX)/bin`.
Since the #define in the tcpborphserver3 code cannot predict what the
user might use for PREFIX, I decided to keep the #define unchanged (for
backwards compatibility) and just create `/bin/kcpfpg` as a symlink to
`$(PREFIX)/bin/kcpfpg`.  This will break if the user sets PREFIX to an
empty string or `/` since it will try to create a symlink to itself.
  • Loading branch information
david-macmahon committed Jul 30, 2018
1 parent 52f71c1 commit 75dde9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions fpg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ $(EXE): $(OBJ)
clean:
$(RM) $(OBJ) core $(EXE)

# Create symlink in /bin so that the upload_to_ram_and_program
# command in tcpborphserver3 will work.
install: all
$(INSTALL) $(EXE) $(PREFIX)/bin
ln -sf $(PREFIX)/bin/$(EXE) /bin/$(EXE)
5 changes: 2 additions & 3 deletions tcpborphserver3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ clean:
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ $(INC)

# Ensure that kcpfpg gets installed
install: all
# Ensure that kcpfpg in installed in /usr so
# that upload_to_ram_and_program will work!
$(MAKE) -C ../fpg PREFIX=/usr $@
$(MAKE) -C ../fpg $@
$(INSTALL) $(SERVER) $(PREFIX)/sbin

test-bof: bof.c
Expand Down

0 comments on commit 75dde9d

Please sign in to comment.