-
Notifications
You must be signed in to change notification settings - Fork 72
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
Updated Makefile to be more friendly for distro packaging #143
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
GIT_DATE := $(firstword $(shell git --no-pager show --date=short --format="%ai" --name-only)) | ||
GIT_VERSION := $(shell git describe --abbrev=0 --tags) | ||
|
||
PREFIX=/usr/local | ||
BINDIR=$(DESTDIR)$(PREFIX)/bin | ||
|
||
# uncomment the line below to include GPIO (For original piHPSDR Controller and Controller2 with i2c) | ||
GPIO_INCLUDE=GPIO | ||
|
||
|
@@ -397,7 +400,7 @@ protocols.o | |
$(PROGRAM): $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(SOAPYSDR_OBJS) \ | ||
$(LOCALCW_OBJS) $(GPIO_OBJS) $(PURESIGNAL_OBJS) \ | ||
$(MIDI_OBJS) $(STEMLAB_OBJS) $(SERVER_OBJS) | ||
$(LINK) -o $(PROGRAM) $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(GPIO_OBJS) \ | ||
$(LINK) -o $(PROGRAM) $(LDFLAGS) $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(GPIO_OBJS) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Support distro LDFLAGS. |
||
$(SOAPYSDR_OBJS) $(LOCALCW_OBJS) $(PURESIGNAL_OBJS) \ | ||
$(MIDI_OBJS) $(STEMLAB_OBJS) $(SERVER_OBJS) $(LIBS) | ||
|
||
|
@@ -436,7 +439,8 @@ clean: | |
|
||
.PHONY: install | ||
install: $(PROGRAM) | ||
cp $(PROGRAM) /usr/local/bin | ||
mkdir -p $(BINDIR); \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make target dir, use variables, support parallel build. |
||
cp -a $(PROGRAM) $(BINDIR) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve built timestamp (maybe better to use install command). |
||
|
||
.PHONY: release | ||
release: $(PROGRAM) | ||
|
@@ -475,13 +479,13 @@ controller2v2: clean $(PROGRAM) | |
############################################################################# | ||
|
||
hpsdrsim.o: hpsdrsim.c hpsdrsim.h | ||
$(CC) -c -O -DALSASOUND hpsdrsim.c | ||
$(CC) $(CFLAGS) -c -O -DALSASOUND hpsdrsim.c | ||
|
||
newhpsdrsim.o: newhpsdrsim.c hpsdrsim.h | ||
$(CC) -c -O newhpsdrsim.c | ||
$(CC) $(CFLAGS) -c -O newhpsdrsim.c | ||
|
||
hpsdrsim: hpsdrsim.o newhpsdrsim.o | ||
$(LINK) -o hpsdrsim hpsdrsim.o newhpsdrsim.o -lasound -lm -lpthread | ||
$(LINK) $(LDFLAGS) -o hpsdrsim hpsdrsim.o newhpsdrsim.o -lasound -lm -lpthread | ||
|
||
|
||
debian: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow PREFIX, BINDIR, DESTDIR override.