configure: when detecting linux include directory for kernel compiler use target...
[AROS.git] / rom / filesys / CDVDFS / src / GNUmakefile
blob3eccdf27c8544f57218fdbfc1f9ed97b4c57c7fc
2 # Makefile for AmiCDROM with GNUC
5 #Turn these flags on to enable debugging
6 #DEBUGLIBS = -ldebug
7 #DEBUGFLAGS = -DDEBUG
9 #And these ones are for normal operation
10 DEBUGLIBS =
11 DEBUGFLAGS = -DNDEBUG
13 # some shortcuts
15 RM = /c/delete quiet
16 NOEXEC = /c/protect flags=-e
17 STRIP = strip --remove-section=.comment
18 CC = gcc
20 OPT =-O2
22 # -fbaserel does not work, -msmall-code likewise, -fno-builtin requires ixemul
24 CFLAGS = $(OPT) -fno-function-cse
26 LDFLAGS1 = -noixemul -nostartfiles
27 LDFLAGS2 = -noixemul
29 OS=$(shell uname)
30 ifeq "$(OS)" "MorphOS"
31 LDLIBS1 =
32 KILLDEV = KillDevice RemCDFS
33 else
34 LDLIBS1 = -lamiga
35 KILLDEV =
36 endif
38 LDLIBS2 =
40 .c.o:
41 $(CC) $(CFLAGS) $(DEBUGFLAGS) -o $@ $< -c
43 # all object files we have
45 OBJS1 = device.o volumes.o intui.o devsupp.o cdrom.o iso9660.o \
46 rock.o joliet.o hfs.o generic.o path.o charset.o prefs.o
47 OBJS2 = main.o cdrom.o iso9660.o rock.o joliet.o hfs.o generic.o path.o charset.o
48 OBJS3 = cdcontrol.o
49 OBJS4 = checkcd.o cdrom.o iso9660.o rock.o joliet.o hfs.o generic.o path.o charset.o
51 # general targets
53 all: cdrom-handler cdrom cdcontrol checkcd $(KILLDEV)
55 cdrom-handler: $(OBJS1)
56 $(CC) $(LDFLAGS1) -o $@ $(OBJS1) $(LDLIBS1) $(DEBUGLIBS)
57 $(STRIP) $@
58 $(NOEXEC) $@
60 cdrom: $(OBJS2)
61 $(CC) $(LDFLAGS2) -o $@ $(OBJS2) $(LDLIBS2) $(DEBUGLIBS)
62 $(STRIP) $@
64 cdcontrol: $(OBJS3)
65 $(CC) $(LDFLAGS2) -o $@ $(OBJS3) $(LDLIBS2) $(DEBUGLIBS)
66 $(STRIP) $@
68 checkcd: $(OBJS4)
69 $(CC) $(LDFLAGS2) -o $@ $(OBJS4) $(LDLIBS2) $(DEBUGLIBS)
70 $(STRIP) $@
72 KillDevice: KillDevice.c
73 $(CC) $(CFLAGS) $(LDFLAGS1) -o $@ KillDevice.c
74 $(STRIP) $@
76 RemCDFS: remcdfs.c
77 $(CC) $(CFLAGS) $(LDFLAGS1) -o $@ $<
78 $(STRIP) $@
80 # dependencies
82 iso9660.o: iso9660.c cdrom.h iso9660.h rock.h generic.h
83 cdrom.o: cdrom.c cdrom.h
84 rock.o: rock.c cdrom.h iso9660.h rock.h generic.h
85 joliet.o: joliet.h iso9660.h
86 device.o: device.c cdrom.h device.h intui.h devsupp.h generic.h \
87 cdcontrol.h rock.h aros_stuff.h
88 devsupp.o: devsupp.c devsupp.h cdrom.h intui.h device.h generic.h params.h
89 intui.o: intui.c intui.h
90 generic.o: generic.c generic.h cdrom.h iso9660.h rock.h joliet.h params.h
91 main.o: main.c cdrom.h iso9660.h rock.h generic.h hfs.h
92 hfs.o: hfs.c hfs.h generic.h cdrom.h params.h
93 cdcontrol.o: cdcontrol.c cdcontrol.h
94 checkcd.o: checkcd.c iso9660.h generic.h cdrom.h rock.h
95 volimes.o: volumes.c volumes.h cdrom.h device.h devsupp.h generic.g debug.h \
96 path.h globals.h aros_stuff.h clib_stuff.h
98 # install
100 install: all
101 Copy cdrom-handler L:
102 Copy cdcontrol cdrom checkcd $(KILLDEV) C:
104 # prepare a distribution
106 dist: all
107 Copy cdrom-handler /L
108 Copy cdcontrol cdrom checkcd $(KILLDEV) /C
111 # delete all nifty stuff
113 clean:
114 -$(RM) *.o cdrom cdrom-handler cdcontrol checkcd KillDevice RemCDFS