-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
52 lines (40 loc) · 1.35 KB
/
makefile
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
#
#########################################################################
# makefile for fstab formatter #
# includes new data dictionary #
# Warning. VPATH should not have any *.o files from this makefile #
# Reminder $< input file $@ output file #
#########################################################################
#
CC=gcc #-Wextra
CFLAGS= -O4 -Wall # -DNDEBUG
srcs=src/*.c
OBJDIR=./obj
OBJS=$(addprefix $(OBJDIR)/,dictionary.o )
#VPATH=./src:
vpath %c ./src
vpath %h ./src
PROGS= fstabxref fstablsblk
all : ${PROGS} src/dictionary.c src/dictionary.h
default : ${PROGS} src/dictionary.c src/dictionary.h
.PHONY : clean all install tar cleantest
clean:
rm -f ${PROGS} *.o $(OBJDIR)/*
cleantest:
rm -f fstabxref.tar *CHECKSUM
install:
cp -rp fstabxref ~/bin
cp -rp fstablsblk ~/bin
fstabxref: fstabxref.c $(OBJS)
${CC} ${CFLAGS} $< $(OBJS) -o $@
fstablsblk: fstablsblk.c $(OBJS)
${CC} ${CFLAGS} $< $(OBJS) -o $@
src/dictionary.c: ../iniParser/src/dictionary.c
cp -f $< $@
src/dictionary.h: ../iniParser/src/dictionary.h
cp -f $< $@
tar:
@sha256sum fstabxref fstablsblk README* >fstabxref.sha256sum.CHECKSUM
tar -cjvf fstabxref.tar fstabxref fstablsblk README* *CHECKSUM
obj/dictionary.o : dictionary.c dictionary.h
$(CC) $(CFLAGS) -c $< -o $@