Introduce src, obj, build, docs & modify Makefile

This commit is contained in:
smirky committed 2018-02-16 15:30:36 +02:00
1 parent 3a0ccd3b31
commit bd9ebee627
29 files changed
+15 -21

No files matched your search

+14 -20
View File
@@ -24,23 +24,17 @@ ifndef LDFLAGS
LDFLAGS += -Wl,-z,relro,-z,now
endif
SOURCES = main.c \
confparser.c \
rmps.c \
enum_functions.c \
log.c \
agent_pool.c \
client_pool.c \
sql.c \
job_queue.c
SRCDIR = src
OBJDIR = obj
BUILDDIR = build
OBJECTS = $(SOURCES:.c=.o)
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
EXECUTABLE = rmpsd
INSTALLDIR := $(DESTDIR)/usr/bin
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(BUILDDIR)/$(EXECUTABLE): $(OBJECTS)
ifeq ($(VERBOSE), yes)
$(CC) $(SQLLDFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
else
@@ -48,25 +42,25 @@ else
@$(CC) $(SQLLDFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
endif
.c.o:
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
ifeq ($(VERBOSE), yes)
$(CC) $(CFLAGS) $(SQLCFLAGS) -c $< -o $@
else
@echo ' CC $@'
@echo ' CC $<'
@$(CC) $(CFLAGS) $(SQLCFLAGS) -c $< -o $@
endif
clean:
rm -f $(OBJECTS) $(EXECUTABLE)
rm -f $(OBJECTS) $(BUILDDIR)/$(EXECUTABLE)
distclean:
rm -f $(OBJECTS)
install:
install -m755 -D $(EXECUTABLE) "$(INSTALLDIR)/$(EXECUTABLE)"
install -m644 -D rmps.conf "$(DESTDIR)/etc/rmps/rmps.conf"
install -m644 -D rmpsd.service "$(DESTDIR)/usr/lib/systemd/system/rmpsd.service"
install -m644 -D enum_codes "$(DESTDIR)/usr/lib/rmps/resources/enum_codes"
install -m755 -D $(BUILDDIR)/$(EXECUTABLE) "$(INSTALLDIR)/$(EXECUTABLE)"
install -m644 -D docs/conf/rmps.conf "$(DESTDIR)/etc/rmps/rmps.conf"
install -m644 -D docs/systemd/rmpsd.service "$(DESTDIR)/usr/lib/systemd/system/rmpsd.service"
install -m644 -D docs/enum_codes "$(DESTDIR)/usr/lib/rmps/resources/enum_codes"
uninstall:
rm -f "$(INSTALLDIR)/$(EXECUTABLE)"
View File
Whitespace-only changes.
View File
File renamed without changes.
@@ -2,7 +2,7 @@
# Just build via makepkg
pkgname=rmps
pkgver=20170822.0
pkgver=20180216.0
pkgrel=1
pkgdesc='Remote Management and Provisioning System'
url='https://git.smirky.net/smirky/rmps.git/'
View File
File renamed without changes.
File renamed without changes.
View File
Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.