aboutsummaryrefslogtreecommitdiff
path: root/Makefile.mingw
blob: 9b4e240b53df9c92ef5945ec559208896668ca9f (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Assumes makefile is used in a MSYS shell with a MinGW compiler available.

SHELL = /bin/sh

PREFIX=/usr/local
INSTDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/man

CC = gcc
LD = gcc

EXECS =	sg_readcap sg_turs sg_inq sg_start sg_modes sg_logs sg_senddiag \
	sg_persist sg_requests sg_ses sg_luns sg_scan \
	sg_sync sg_prevent sg_get_config sg_wr_mode \
	sg_rtpg sg_reassign sg_format sg_rmsn sg_ident \
	sg_read_long sg_write_long sg_verify sg_rdac sg_vpd \
	sg_sat_identify sg_read_buffer sg_write_buffer sg_opcodes \
	sg_raw

EXE_S =	sg_readcap.exe sg_turs.exe sg_inq.exe sg_start.exe sg_modes.exe \
	sg_logs.exe sg_senddiag.exe sg_persist.exe sg_requests.exe \
	sg_ses.exe sg_luns.exe sg_scan.exe sg_sync.exe sg_prevent.exe \
	sg_get_config.exe sg_wr_mode.exe sg_rtpg.exe sg_reassign.exe \
	sg_format.exe sg_rmsn.exe sg_ident.exe sg_read_long.exe \
	sg_write_long.exe sg_verify.exe sg_rdac.exe sg_vpd.exe \
	sg_sat_identify.exe sg_read_buffer.exe sg_write_buffer.exe \
	sg_opcodes.exe sg_raw.exe

OS_FLAGS = -DSG3_UTILS_WIN32 -DSG3_UTILS_MINGW -DSPTD
# OS_FLAGS = -DSG3_UTILS_WIN32 -DSG3_UTILS_MINGW
LARGE_FILE_FLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
EXTRA_FLAGS = $(OS_FLAGS) $(LARGE_FILE_FLAGS)

# CFLAGS = -O2 -Wall -W $(EXTRA_FLAGS)
CFLAGS = -g -O2 -Wall -W $(EXTRA_FLAGS)
# CFLAGS = -g -O2 -Wall -W -pedantic -std=c99 $(EXTRA_FLAGS)

O_FILES = sg_lib.o sg_cmds_basic.o sg_cmds_extra.o sg_pt_win32.o
O_BFILES = sg_lib.o sg_cmds_basic.o sg_pt_win32.o
O_RFILES = sg_lib.o sg_pt_win32.o
O_SFILES = sg_lib.o

LDFLAGS = 

all: $(EXECS)

clean:
	rm *.o $(EXE_S)

.c.o:
	$(CC) $(INCLUDES) $(CFLAGS) $(S_CFLAGS) -c -o $@ $<

sg_readcap: sg_readcap.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_turs: sg_turs.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_inq: sg_inq.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_start: sg_start.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_modes: sg_modes.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_logs: sg_logs.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_senddiag: sg_senddiag.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_persist: sg_persist.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_requests: sg_requests.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_ses: sg_ses.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_luns: sg_luns.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_scan: sg_scan.o $(O_SFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_SFILES)

sg_sync: sg_sync.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_prevent: sg_prevent.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_get_config: sg_get_config.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_wr_mode: sg_wr_mode.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_rtpg: sg_rtpg.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_reassign: sg_reassign.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_format: sg_format.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_rmsn: sg_rmsn.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_ident: sg_ident.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_read_long: sg_read_long.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_write_long: sg_write_long.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_verify: sg_verify.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_rdac: sg_rdac.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_vpd: sg_vpd.o sg_vpd_vendor.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o sg_vpd_vendor.o $(O_BFILES)

sg_sat_identify: sg_sat_identify.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_read_buffer: sg_read_buffer.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_write_buffer: sg_write_buffer.o $(O_FILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_FILES)

sg_opcodes: sg_opcodes.o $(O_BFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_BFILES)

sg_raw: sg_raw.o $(O_RFILES)
	$(LD) -o $@ $(LDFLAGS) $@.o $(O_RFILES)