-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (69 loc) · 2.86 KB
/
Makefile
File metadata and controls
103 lines (69 loc) · 2.86 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# dmklib
# Makefile
# $Id: Makefile 43 2003-12-22 00:08:05Z eric $
# Copyright 2002 Eric Smith <eric@brouhaha.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation. Note that permission is
# not granted to redistribute this program under the terms of any
# other version of the General Public License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
# -----------------------------------------------------------------------------
# options
# -----------------------------------------------------------------------------
CFLAGS = -g -Wall $(DEFINES)
LDFLAGS = -g
# -----------------------------------------------------------------------------
# You shouldn't have to change anything below this point, but if you do please
# let me know why so I can improve this Makefile.
# -----------------------------------------------------------------------------
PACKAGE = dmklib
VERSION = 0.31
DISTNAME = $(PACKAGE)-$(VERSION)
DATE := $(shell date +%Y.%m.%d)
SNAPNAME = $(PACKAGE)-$(DATE)
TARGETS = libdmk.o rfloppy dmkformat dmk2raw dumpids
HEADERS = libdmk.h dmk.h
SOURCES = libdmk.c rfloppy.c dmkformat.c dmk2raw.c dumpids.c
DEFINES = -DDMKLIB_VERSION=$(VERSION)
OTHERSRC = Makefile
MISC = COPYING README
OBJECTS = $(SOURCES:.c=.o)
DEPENDS = $(SOURCES:.c=.d)
DISTFILES = $(MISC) $(OTHERSRC) $(HEADERS) $(SOURCES)
all: $(TARGETS) $(MISC_TARGETS)
# -----------------------------------------------------------------------------
# Artificial targets.
# -----------------------------------------------------------------------------
dist: $(DISTNAME).tar.gz
snap: $(SNAPNAME).tar.gz
%.tar.gz: $(DISTFILES)
-rm -rf $@ $*
mkdir $*
for f in $(DISTFILES); do ln $$f $*/$$f; done
tar --gzip -chf $@ $*
-rm -rf $*
clean:
rm -f $(TARGETS) $(MISC_TARGETS) $(OBJECTS) $(DEPENDS)
# -----------------------------------------------------------------------------
# Real targets.
# -----------------------------------------------------------------------------
rfloppy: rfloppy.o libdmk.o
dmkformat: dmkformat.o libdmk.o
dmk2raw: dmk2raw.o libdmk.o
dumpids: dumpids.o
# -----------------------------------------------------------------------------
# Automatically generate dependencies.
# -----------------------------------------------------------------------------
%.d: %.c
$(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
include $(DEPENDS)