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