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

Makefile instead shell scripts #9

Open
3ed opened this issue Jun 1, 2020 · 0 comments
Open

Makefile instead shell scripts #9

3ed opened this issue Jun 1, 2020 · 0 comments

Comments

@3ed
Copy link

3ed commented Jun 1, 2020

This method respect CFLAGS variable and is easier to use. Add this Makefile to root dir of project:

CFLAGS_EXTRA ?= -Wall -fPIC -std=c99 -shared -O2 -I/usr/include/deadbeef
PREFIX ?= $(HOME)/.local
LIBDIR ?= /lib/deadbeef

build:
	$(CC) $(CFLAGS) $(CFLAGS_EXTRA) rating.c -o rating.so

clean:
	test -f rating.so && rm rating.so || true

install:
	install -d "$(DESTDIR)$(PREFIX)$(LIBDIR)"
	install "rating.so" "$(DESTDIR)$(PREFIX)$(LIBDIR)/rating.so"

uninstall:
	rm "$(DESTDIR)$(PREFIX)$(LIBDIR)/rating.so"

To do local instalation:

make
make install

To do system/global instalation:

make
make install PREFIX=/usr

To uninstall replace install with uninstall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant