-
Notifications
You must be signed in to change notification settings - Fork 6
/
makefile
57 lines (41 loc) · 1.14 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
CC = ppc-amigaos-gcc
STRIP = ppc-amigaos-strip
TARGET = smb2-handler
VERSION = 53
LIBSMB2DIR = libsmb2-git
OPTIMIZE = -O2
DEBUG = -gstabs
INCLUDES = -I. -I./src -I./$(LIBSMB2DIR)/include
DEFINES =
WARNINGS = -Wall -Wwrite-strings -Werror
CFLAGS = $(OPTIMIZE) $(DEBUG) $(INCLUDES) $(DEFINES) $(WARNINGS)
LDFLAGS = -static
LIBS =
STRIPFLAGS = -R.comment --strip-unneeded-rel-relocs
SRCS = start.c main.c error-req.c time.c bsdsocket-stubs.c marshalling.c \
reaction/password-req.c
OBJS = $(addprefix obj/,$(SRCS:.c=.o))
DEPS = $(OBJS:.o=.d)
.PHONY: all
all: bin/$(TARGET)
-include $(DEPS)
obj/%.o: src/%.c
@mkdir -p $(dir $@)
$(CC) -MM -MP -MT $(@:.o=.d) -MT $@ -MF $(@:.o=.d) $(CFLAGS) $<
$(CC) $(CFLAGS) -c -o $@ $<
.PHONY: build-libsmb2
build-libsmb2:
$(MAKE) -C $(LIBSMB2DIR) bin/libsmb2.a
$(LIBSMB2DIR)/bin/libsmb2.a: build-libsmb2
@true
bin/$(TARGET): $(OBJS) $(LIBSMB2DIR)/bin/libsmb2.a
@mkdir -p $(dir $@)
$(CC) $(LDFLAGS) -o $@.debug $^ $(LIBS)
$(STRIP) $(STRIPFLAGS) -o $@ $@.debug
.PHONY: clean
clean:
$(MAKE) -C $(LIBSMB2DIR) clean
rm -rf bin obj
.PHONY: revision
revision:
bumprev -e is $(VERSION) $(TARGET)