-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
52 lines (36 loc) · 951 Bytes
/
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
#Makefile autogenerated by RcB2
prefix = /usr/local
bindir = $(prefix)/bin
PROG = sdlbook
SRCS = sdlbook.c
ifeq ($(SDL2),)
SDL_LIBS = -lSDL
CPPF_SDL =
else
SDL_LIBS = -lSDL2
CPPF_SDL = -DUSE_SDL2
endif
LIBS = -ldjvulibre -lmupdf $(SDL_LIBS) -lm
CFLAGS_N =
CPPFLAGS_N = $(CPPF_SDL)
LDFLAGS_N =
OBJS = $(SRCS:.c=.o)
MAKEFILE := $(firstword $(MAKEFILE_LIST))
-include config.mak
all: $(PROG)
clean:
rm -f $(PROG)
rm -f $(OBJS)
rebuild:
$(MAKE) -f $(MAKEFILE) clean && $(MAKE) -f $(MAKEFILE) all
install: $(PROG)
install -d $(DESTDIR)/$(bindir)
install -D -m 755 $(PROG) $(DESTDIR)/$(bindir)/
src: $(SRCS)
$(CC) $(CPPFLAGS_N) $(CPPFLAGS) $(CFLAGS_N) $(CFLAGS) -o $(PROG) $^ $(LDFLAGS_N) $(LDFLAGS) $(LIBS)
sdlbook.o: ezsdl.h
%.o: %.c
$(CC) $(CPPFLAGS_N) $(CPPFLAGS) $(CFLAGS_N) $(CFLAGS) -c -o $@ $<
$(PROG): $(OBJS)
$(CC) $(CFLAGS_N) $(CFLAGS) $(LDFLAGS_N) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
.PHONY: all clean rebuild install src