-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (70 loc) · 2.27 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
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
###
### Makefile for disktype
###
RM = rm -f
CC = gcc
OBJS = main.o lib.o \
buffer.o file.o cdaccess.o cdimage.o vpc.o compressed.o \
detect.o apple.o amiga.o atari.o dos.o cdrom.o \
linux.o unix.o beos.o archives.o \
udf.o blank.o cloop.o
TARGET = disktype
CPPFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CFLAGS = -Wall
LDFLAGS =
LIBS =
ifeq ($(NOSYS),)
system = $(shell uname)
ifeq ($(system),Linux)
CPPFLAGS += -DUSE_IOCTL_LINUX
endif
ifeq ($(system),FreeBSD)
# not entirely tested yet
#CPPFLAGS += -DUSE_IOCTL_FREEBSD
endif
ifeq ($(system),Darwin)
CPPFLAGS += -DUSE_MACOS_TYPE -DUSE_IOCTL_DARWIN
LIBS += -framework CoreServices
ifeq (/Developer/SDKs/MacOSX10.4u.sdk,$(wildcard /Developer/SDKs/MacOSX10.4u.sdk))
CPPFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
CFLAGS += -arch i386 -arch ppc -mmacosx-version-min=10.4
LDFLAGS += -arch i386 -arch ppc -mmacosx-version-min=10.4 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
else
ifeq (/Developer/SDKs/MacOSX10.5.sdk,$(wildcard /Developer/SDKs/MacOSX10.5.sdk))
CPPFLAGS += -isysroot /Developer/SDKs/MacOSX10.5.sdk
CFLAGS += -arch i386 -arch ppc -mmacosx-version-min=10.5
LDFLAGS += -arch i386 -arch ppc -mmacosx-version-min=10.5 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk
else
ifeq (/Developer/SDKs/MacOSX10.6.sdk,$(wildcard /Developer/SDKs/MacOSX10.6.sdk))
CPPFLAGS += -isysroot /Developer/SDKs/MacOSX10.6.sdk
CFLAGS += -arch i386 -arch ppc -mmacosx-version-min=10.6
LDFLAGS += -arch i386 -arch ppc -mmacosx-version-min=10.6 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk
endif
endif
endif
endif
ifeq ($(system),AmigaOS)
CC += -noixemul
CFLAGS += -m68020-60 -msmall-code
LDFLAGS += -m68020-60
endif
endif
# real making
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
$(OBJS): %.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
# cleanup
clean:
$(RM) *.o *~ *% $(TARGET)
distclean: clean
$(RM) .depend
# automatic dependencies
depend: dep
dep:
for i in $(OBJS:.o=.c) ; do $(CC) $(CPPFLAGS) -MM $$i ; done > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif
# eof