Introduce src, obj, build, docs & modify Makefile
This commit is contained in:
34
Makefile
34
Makefile
@@ -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)"
|
||||
|
||||
0
build/.gitkeep
Normal file
0
build/.gitkeep
Normal file
@@ -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/'
|
||||
0
obj/.gitkeep
Normal file
0
obj/.gitkeep
Normal file
Reference in New Issue
Block a user