quest/Makefile

39 lines
934 B
Makefile
Raw Permalink Normal View History

2021-09-05 02:50:19 +10:00
TARGET = quest
2022-02-04 23:13:51 +11:00
LIBS = -lm -luiohook -lcjson
2021-08-11 23:50:59 +10:00
CC = gcc
CFLAGS = -g -Wall
INSTALL_PATH = /usr/local
2022-01-16 15:47:04 +11:00
VERSION = 0.6.0
2021-08-11 23:50:59 +10:00
.PHONY: default all clean
default: $(TARGET)
all: default
2021-09-17 09:25:36 +10:00
OBJECTS = $(patsubst src/%.c, %.o, $(wildcard src/*.c))
2021-08-11 23:50:59 +10:00
HEADERS = $(wildcard *.h)
2021-09-17 09:25:36 +10:00
%.o: src/%.c $(HEADERS)
2021-08-11 23:50:59 +10:00
$(CC) $(CFLAGS) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -Wall $(LIBS) -o $@
clean:
-rm -f *.o
-rm -f $(TARGET)
install: all
mkdir -p $(DESTDIR)$(INSTALL_PATH)/bin
cp -f $(TARGET) $(DESTDIR)$(INSTALL_PATH)/bin
chmod 755 $(DESTDIR)$(INSTALL_PATH)/bin/$(TARGET)
mkdir -p $(DESTDIR)$(INSTALL_PATH)/share/man/man1
sed "s/VERSION/$(VERSION)/g" < docs/$(TARGET).1 > $(DESTDIR)$(INSTALL_PATH)/share/man/man1/$(TARGET).1
chmod 644 $(DESTDIR)$(INSTALL_PATH)/share/man/man1/$(TARGET).1
uninstall:
rm -f $(DESTDIR)$(INSTALL_PATH)/bin/$(TARGET)\
$(DESTDIR)$(INSTALL_PATH)/share/man/man1/$(TARGET).1