diff options
author | nirav <nirav@teisuu.com> | 2019-03-07 01:27:55 +0530 |
---|---|---|
committer | Dandelion <nirav@teisuu.com> | 2019-03-07 01:27:55 +0530 |
commit | 6dd58a30761eca36544c4e815b36907eab084949 (patch) | |
tree | c1bc857a14fffe6f35f7405f133c0ed114aec1a4 /Makefile | |
download | ap_client-6dd58a30761eca36544c4e815b36907eab084949.tar.gz ap_client-6dd58a30761eca36544c4e815b36907eab084949.zip |
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..663d8e6 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +CC=cc +PKGCONFIG=$(shell which pkg-config) + +CFLAGS=-o2 -pipe +CFLAGS+=-Wall -Wextra -Wno-unused-parameter +CFLAGS+=$(shell $(PKGCONFIG) --cflags gtk+-3.0 libcurl jansson) +LDFLAGS+=$(shell $(PKGCONFIG) --libs gtk+-3.0 libcurl jansson) +DESTDIR= +PREFIX=/usr/local +BINDIR=$(PREFIX)/bin + +OUTDIR=build +OBJECTS=$(OUTDIR)/main.o \ + $(OUTDIR)/string-util.o \ + $(OUTDIR)/instance_info.o \ + $(OUTDIR)/http.o \ + $(OUTDIR)/status.o \ + $(OUTDIR)/timeline.o \ + $(OUTDIR)/auth.o \ + $(OUTDIR)/window.o + +all: ap_client + +ap_client: $(OBJECTS) + $(CC) $(LDFLAGS) -o ap_client $(OBJECTS) + +$(OUTDIR)/%.o: src/%.c src/*.h + @mkdir -p $(OUTDIR) + $(CC) $(CFLAGS) -c -o $@ $< + +install: ap_client + mkdir -p $(DESTDIR)$(BINDIR) + cp ap_client $(DESTDIR)$(BINDIR)/ap_client + chmod 0775 $(DESTDIR)$(BINDIR)/ap_client + +clean: + rm -f ap_client + rm -rf $(OUTDIR) + +uninstall: + rm -f $(DESTDIR)$(BINDIR)/ap_client + +.PHONY: all clean install uninstall |