-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
49 lines (38 loc) · 1.4 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
# Thomas Bernard
CFLAGS = -Wall -Werror
# debug
CFLAGS += -g
# cross compiler for win32
MINGW32CC ?= $(shell which mingw32-gcc || which i586-mingw32msvc-gcc \
|| which i686-w64-mingw32-gcc)
SRCS=hfscommon.c hfspatchnoautofolder.c hfsunhide.c \
hfsdisplay.c hfsrename.c
OBJS=$(addsuffix .o, $(basename $(SRCS)))
WIN32OBJS=$(addsuffix .w32.o, $(basename $(SRCS)))
BINS=hfsdisplay hfspatchnoautofolder hfsunhide hfsrename
# comment the next line if you don't need to build the win32 executables
EXES=$(addsuffix .exe, $(BINS))
all: $(addprefix bin/, $(BINS) $(EXES))
depend:
makedepend -Y $(addprefix src/, $(SRCS)) 2>/dev/null
clean:
$(RM) $(addprefix objs/, $(OBJS) $(WIN32OBJS))
$(RM) $(addprefix bin/, $(BINS) $(EXES))
dist: all
zip dist/`date +%Y%m%d-%H%S`_hfspluspatch.zip $(addprefix bin/, $(EXES)) src/*.c src/*.h Makefile
distbin: $(addprefix bin/, $(BINS) $(EXES))
zip -j dist/`date +%Y%m%d-%H%S`_hfspluspatch_bin.zip $^
$(addprefix bin/, $(BINS)): bin/%: objs/%.o objs/hfscommon.o
$(CC) -o $@ $^
$(addprefix bin/, $(EXES)): bin/%.exe: objs/%.w32.o objs/hfscommon.w32.o
$(MINGW32CC) -o $@ $^
objs/%.o: src/%.c
$(CC) -c $(CFLAGS) -o $@ $<
objs/%.w32.o: src/%.c
$(MINGW32CC) -c $(CFLAGS) -o $@ $<
# DO NOT DELETE
src/hfscommon.o: src/hfscommon.h
src/hfspatchnoautofolder.o: src/hfscommon.h
src/hfsunhide.o: src/hfscommon.h
src/hfsdisplay.o: src/hfscommon.h
src/hfsrename.o: src/hfscommon.h