Browse Source

Add chroot target

master
Causal Agent 6 months ago
parent
commit
2dff04dbef
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
2 changed files with 25 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 24
    0
      Makefile

+ 1
- 0
.gitignore View File

@@ -1,4 +1,5 @@
1 1
 *.o
2 2
 2048.scores
3
+config.mk
3 4
 play
4 5
 tags

+ 24
- 0
Makefile View File

@@ -1,6 +1,12 @@
1
+CHROOT_USER = play
2
+CHROOT_GROUP = $(CHROOT_USER)
3
+
1 4
 CFLAGS += -std=c11 -Wall -Wextra
5
+LDFLAGS = -static
2 6
 LDLIBS = -lcurses
3 7
 
8
+-include config.mk
9
+
4 10
 OBJS += play.o
5 11
 OBJS += 2048.o
6 12
 
@@ -11,3 +17,21 @@ play: $(OBJS)
11 17
 
12 18
 tags: *.c
13 19
 	ctags -w *.c
20
+
21
+chroot.tar: play
22
+	install -d -o root -g wheel \
23
+		root \
24
+		root/bin \
25
+		root/home \
26
+		root/usr/share/misc
27
+	install -d -o $(CHROOT_USER) -g $(CHROOT_GROUP) root/home/$(CHROOT_USER)
28
+	cp -fp /usr/share/misc/termcap.db root/usr/share/misc
29
+	cp -fp /rescue/sh root/bin
30
+	install play root/bin
31
+	tar -c -f chroot.tar -C root bin home usr
32
+
33
+clean:
34
+	rm -fr play $(OBJS) tags chroot.tar root
35
+
36
+install: chroot.tar
37
+	tar -x -f chroot.tar -C /home/$(CHROOT_USER)

Loading…
Cancel
Save