2016-02-18 16:16:02 -05:00
|
|
|
SOFTWARE_MEANT_FOR_SORTIX=1
|
|
|
|
include ../build-aux/platform.mak
|
|
|
|
include ../build-aux/compiler.mak
|
|
|
|
include ../build-aux/version.mak
|
|
|
|
include ../build-aux/dirs.mak
|
|
|
|
|
|
|
|
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
|
|
|
|
CFLAGS?=$(OPTLEVEL)
|
|
|
|
|
|
|
|
CFLAGS:=$(CFLAGS) -Wall -Wextra
|
|
|
|
CPPFLAGS:=$(CPPFLAGS) -DVERSIONSTR=\"$(VERSION)\"
|
|
|
|
|
|
|
|
MAIN_OBJS=\
|
|
|
|
sysinstall.o \
|
|
|
|
sysmerge.o \
|
|
|
|
sysupgrade.o \
|
|
|
|
|
|
|
|
UTIL_OBJS=\
|
|
|
|
conf.o \
|
|
|
|
devices.o \
|
|
|
|
execute.o \
|
|
|
|
fileops.o \
|
2016-08-22 18:28:49 -04:00
|
|
|
hooks.o \
|
2016-02-18 16:16:02 -05:00
|
|
|
interactive.o \
|
|
|
|
manifest.o \
|
|
|
|
release.o \
|
2021-01-18 18:04:56 -05:00
|
|
|
string_array.o \
|
2016-02-18 16:16:02 -05:00
|
|
|
|
|
|
|
OBJS=$(MAIN_OBJS) $(UTIL_OBJS)
|
|
|
|
|
2021-01-18 18:04:56 -05:00
|
|
|
SYSINSTALL_DEPS=conf devices execute fileops interactive manifest release string_array
|
|
|
|
SYSMERGE_DEPS=conf fileops execute hooks manifest release string_array
|
|
|
|
SYSUPGRADE_DEPS=conf devices execute fileops hooks interactive manifest release string_array
|
2016-02-18 16:16:02 -05:00
|
|
|
|
|
|
|
SYSINSTALL_OBJS:=sysinstall.o $(SYSINSTALL_DEPS:=.o)
|
|
|
|
SYSMERGE_OBJS:=sysmerge.o $(SYSMERGE_DEPS:=.o)
|
|
|
|
SYSUPGRADE_OBJS:=sysupgrade.o $(SYSUPGRADE_DEPS:=.o)
|
|
|
|
|
|
|
|
all: sysinstall sysmerge sysupgrade
|
|
|
|
|
|
|
|
.PHONY: all install clean
|
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(SBINDIR)
|
|
|
|
install sysinstall $(DESTDIR)$(SBINDIR)
|
|
|
|
install sysmerge $(DESTDIR)$(SBINDIR)
|
|
|
|
install sysupgrade $(DESTDIR)$(SBINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man8
|
2016-02-28 19:35:13 -05:00
|
|
|
cp sysinstall.8 $(DESTDIR)$(MANDIR)/man8/sysinstall.8
|
|
|
|
cp sysmerge.8 $(DESTDIR)$(MANDIR)/man8/sysmerge.8
|
|
|
|
cp sysupgrade.8 $(DESTDIR)$(MANDIR)/man8/sysupgrade.8
|
2020-12-27 16:32:04 -05:00
|
|
|
mkdir -p $(DESTDIR)$(DATADIR)/sysinstall/hooks
|
|
|
|
# TODO: After releasing Sortix 1.1, remove this compatibility.
|
|
|
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-random-seed
|
2020-12-27 16:48:27 -05:00
|
|
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-tix-manifest-mode
|
2021-01-18 18:04:56 -05:00
|
|
|
touch $(DESTDIR)$(DATADIR)/sysinstall/hooks/sortix-1.1-leaked-files
|
2016-02-18 16:16:02 -05:00
|
|
|
|
|
|
|
sysinstall: $(SYSINSTALL_OBJS)
|
|
|
|
$(CC) $(SYSINSTALL_OBJS) -o $@ -lmount
|
|
|
|
|
|
|
|
sysmerge: $(SYSMERGE_OBJS)
|
|
|
|
$(CC) $(SYSMERGE_OBJS) -o $@ -lmount
|
|
|
|
|
|
|
|
sysupgrade: $(SYSUPGRADE_OBJS)
|
|
|
|
$(CC) $(SYSUPGRADE_OBJS) -o $@ -lmount
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -std=gnu11 -c $< -o $@
|
|
|
|
|
|
|
|
sysinstall.o: $(SYSINSTALL_DEPS:=.h)
|
|
|
|
sysmerge.o: $(SYSMERGE_DEPS:=.h)
|
|
|
|
sysupgrade.o: $(SYSUPGRADE_DEPS:=.h)
|
|
|
|
conf.o: conf.h
|
|
|
|
devices.o: devices.h
|
|
|
|
execute.o: execute.h
|
2021-01-18 18:04:56 -05:00
|
|
|
fileops.o: fileops.h string_array.h
|
|
|
|
string_array.o: string_array.h
|
|
|
|
hooks.o: fileops.h manifest.h release.h string_array.h
|
2016-02-18 16:16:02 -05:00
|
|
|
interactive.o: interactive.h execute.h
|
2021-01-18 18:04:56 -05:00
|
|
|
manifest.o: manifest.h fileops.h string_array.h
|
2016-02-18 16:16:02 -05:00
|
|
|
release.o: release.h
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f sysinstall sysmerge sysupgrade $(OBJS)
|