File: Makefile

package info (click to toggle)
winregfs 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 384 kB
  • sloc: ansic: 4,897; makefile: 173; sh: 65
file content (60 lines) | stat: -rw-r--r-- 2,268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
CC=gcc
INSTALL?=install
PKG_CONFIG?=pkg-config
CFLAGS+=-O2 -g -fPIE
#CFLAGS=-O2 -flto -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables
#CFLAGS=-Og -g3
BUILD_CFLAGS = -std=gnu99 -I. -D_FILE_OFFSET_BITS=64 -pipe -fstrict-aliasing
#BUILD_CFLAGS += -Wall -Wextra -Wstrict-aliasing -Wcast-align -pedantic -Wno-unused-parameter
BUILD_CFLAGS += -Wall -Wextra -Wwrite-strings -Wcast-align -Wstrict-aliasing -pedantic -Wstrict-overflow -Wstrict-prototypes -Wpointer-arith -Wundef
BUILD_CFLAGS += -Wshadow -Wfloat-equal -Wstrict-overflow=5 -Waggregate-return -Wcast-qual -Wswitch-default -Wswitch-enum -Wunreachable-code -Wformat=2 -Winit-self
LDFLAGS+=-s -pie
#LDFLAGS=-flto -s -Wl,--gc-sections
#LDFLAGS=
FUSE_CFLAGS=$(shell $(PKG_CONFIG) fuse3 --cflags)
FUSE_LDFLAGS=$(shell $(PKG_CONFIG) fuse3 --libs)
FUSE_LIBS=-lfuse3

prefix=/usr
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
mandir=${prefix}/share/man
datarootdir=${prefix}/share
datadir=${datarootdir}
sysconfdir=${prefix}/etc

OBJS_LIB=ntreg.o jody_string.o
OBJS_FSCK=fsck_winregfs.o $(OBJS_LIB)
OBJS_MOUNT=winregfs.o jody_hash.o $(OBJS_LIB)

BUILD_CFLAGS += $(CFLAGS_EXTRA)

all: mount.winregfs fsck.winregfs manual

mount.winregfs: $(OBJS_MOUNT)
	$(CC) $(CFLAGS) $(LDFLAGS) $(FUSE_CFLAGS) $(BUILD_CFLAGS) $(FUSE_LDFLAGS) -o mount.winregfs $(OBJS_MOUNT) $(FUSE_LIBS)

fsck.winregfs: $(OBJS_FSCK)
	$(CC) $(CFLAGS) $(LDFLAGS) $(FUSE_CFLAGS) $(BUILD_CFLAGS) $(FUSE_LDFLAGS) -o fsck.winregfs $(OBJS_FSCK)

manual:
	gzip -9 < mount.winregfs.8 > mount.winregfs.8.gz
	gzip -9 < fsck.winregfs.8 > fsck.winregfs.8.gz

.c.o:
	$(CC) -c $(BUILD_CFLAGS) $(FUSE_CFLAGS) $(CFLAGS) $(CPPFLAGS) $<

clean:
	rm -f *.o *~ mount.winregfs fsck.winregfs debug.log *.?.gz

distclean:
	rm -f *.o *~ mount.winregfs fsck.winregfs debug.log *.?.gz winregfs*.pkg.tar.*

install: all
	$(INSTALL) -D -o root -g root -m 0644 mount.winregfs.8.gz $(DESTDIR)/$(mandir)/man8/mount.winregfs.8.gz
	$(INSTALL) -D -o root -g root -m 0644 fsck.winregfs.8.gz $(DESTDIR)/$(mandir)/man8/fsck.winregfs.8.gz
	$(INSTALL) -D -o root -g root -m 0755 -s mount.winregfs $(DESTDIR)/$(bindir)/mount.winregfs
	$(INSTALL) -D -o root -g root -m 0755 -s fsck.winregfs $(DESTDIR)/$(bindir)/fsck.winregfs

package:
	+./chroot_build.sh