diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | Pull requests | README | LICENSE

Makefile (1696B)


      1 TARGET = diary
      2 SRCDIR = src/
      3 _SRC = diary-tp.c export.c import.c utils.c caldav.c diary.c
      4 SRC = $(addprefix $(SRCDIR), $(_SRC))
      5 PREFIX ?= /usr/local
      6 BINDIR ?= $(DESTDIR)$(PREFIX)/bin
      7 
      8 MANDIR := $(DESTDIR)$(PREFIX)/share/man
      9 MAN1 = man1/diary.1
     10 
     11 CC = gcc
     12 CFLAGS = -Wall $(shell pkg-config libxml-2.0 --cflags)
     13 UNAME = $(shell uname)
     14 
     15 XML_LIBS = $(shell pkg-config libxml-2.0 --libs)
     16 
     17 ifeq ($(UNAME),FreeBSD)
     18 	LIBS = -lncurses -lcurl $(ML_LIBS) -ldl -llttng-ust -pthread
     19 endif
     20 
     21 ifeq ($(UNAME),Linux)
     22 	LIBS = -lncursesw -lcurl $(XML_LIBS) -ldl -llttng-ust -pthread
     23 endif
     24 
     25 ifeq ($(UNAME),Darwin)
     26 	LIBS = -lncurses -lcurl $(XML_LIBS) -ldl -llttng-ust -pthread -framework CoreFoundation
     27 endif
     28 
     29 
     30 default: $(TARGET)
     31 
     32 $(TARGET): $(SRC)
     33 	@# -I: Search this dir for header files (required for lttng)
     34 	$(CC) -I $(SRCDIR) $(SRC) -o $(TARGET) $(CFLAGS) $(LIBS)
     35 
     36 debug: $(SRC) lttng
     37 	@# -g: Produce debugging information (for GDB)
     38 	$(CC) -I $(SRCDIR) $(SRC) -o $(TARGET) $(CFLAGS) -g $(LIBS)
     39 
     40 # The tracepoint provider package shared object can be
     41 # preloaded before the instrumented application starts.
     42 # https://lttng.org/docs/v2.13/#doc-building-tracepoint-providers-and-user-application
     43 lttng:
     44 	@# -fpic: Generate position-independent code (PIC) suitable for shared library
     45 	$(CC) -I $(SRCDIR) -fpic -c $(SRCDIR)/diary-tp.c
     46 	@# create shared object file (.so)
     47 	$(CC) -shared -o libtpp.so diary-tp.o -llttng-ust -ldl
     48 
     49 clean:
     50 	@# cleanup target and lttng shared object file
     51 	rm -f $(TARGET) libtpp.so diary-tp.o
     52 
     53 install: $(TARGET)
     54 	install -m755 $(TARGET) $(BINDIR)/$(TARGET)
     55 	install -d $(MANDIR)/man1
     56 	install -m644 $(MAN1) $(MANDIR)/$(MAN1)
     57 
     58 uninstall:
     59 	rm -f $(BINDIR)/$(TARGET)
     60 	rm -f $(MANDIR)/$(MAN1)