diff options
-rwxr-xr-x | Makefile | 31 |
1 files changed, 19 insertions, 12 deletions
@@ -1,13 +1,21 @@ PREFIX = /usr/local/bin CC = gcc -CFLAGS = -Wall -g \ - $(shell gpgme-config --cflags --libs) #-DDEBUG +CFLAGS = -Wall -g #-DDEBUG +LIBS = $(shell gpgme-config --cflags --libs) +MAN_PATH = /usr/share/man/man1 +SOURCES = src/main.c \ + src/exec-cmd.c \ + src/routines.c \ + src/easydir.c \ + src/r-gpgme.c \ + src/tree.c \ + src/xstd.c ifdef DISPLAY - CFLAGS += -lX11 -DDISPLAY + LIBS += -lX11 + CFLAGS += -DDISPLAY + SOURCES += src/r-x11.c endif -MAN_PATH = /usr/share/man/man1 -SOURCES = src/*.c -OBJECTS = *.o +OBJECTS = ${SOURCES:.c=.o} MAN_SOURCES = man/lpass.1 MAN_OBJECTS = lpass.1.gz EXECUTABLE = lpass @@ -17,14 +25,13 @@ EXECUTABLE = lpass all: $(EXECUTABLE) clean: - @rm -rf $(EXECUTABLE) $(OBJECTS) - @rm -rf $(MAN_OBJECTS) - -$(OBJECTS): - @$(CC) -c $(CFLAGS) $(SOURCES) + @rm -rf $(EXECUTABLE) $(OBJECTS) $(MAN_OBJECTS) $(EXECUTABLE): $(OBJECTS) - @$(CC) $(CFLAGS) -o $(EXECUTABLE) $(OBJECTS) + @$(CC) $(CFLAGS) $(LIBS) -o $(EXECUTABLE) $(OBJECTS) + +%.o: %.c + @$(CC) $(CFLAGS) $(LIBS) -c $< -o $@ install: all @echo installing files to $(PREFIX) |