-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 1.64 KB
/
Makefile
File metadata and controls
66 lines (53 loc) · 1.64 KB
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
# run `make DEF=...` to add extra defines,
# conditional compile flags:
# NOLIBRAW=1 - not use libraw & libgd
# NOTIFF - not use libtiff
# NOCFITSIO - not use cfitsio
#
LDFLAGS := -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,--discard-all
LDFLAGS += -lm -pthread
LDIMG :=
SRCS := $(wildcard *.c)
DEFINES := $(DEF) -D_GNU_SOURCE -D_XOPEN_SOURCE=1111
#DEFINES += -DEBUG
CFLAGS += -Wall -Wextra -O2
OBJS := $(SRCS:%.c=%.o)
CC = gcc
CPP = g++
TARGETS := sbig340_daemon
ifndef NOLIBRAW
LDIMG += $(shell pkg-config --libs libraw) -lgd
CFLAGS += $(shell pkg-config --cflags libraw)
DEBAYER := debayer.o
DEFINES += -DLIBRAW
endif
ifndef NOTIFF
LDIMG += -ltiff
DEFINES += -DLIBTIFF
endif
ifndef NOCFITSIO
LDIMG += $(shell pkg-config --libs cfitsio)
DEFINES += -DLIBCFITSIO
endif
all : sbig340_daemon sbig340_standalone sbig340_client
debayer.o : debayer.cpp
@echo -e "\t\tG++ debayer"
$(CPP) $(CFLAGS) $(DEFINES) debayer.cpp -c
sbig340_standalone : $(SRCS) $(DEBAYER)
@echo -e "\t\tBuild standalone"
$(CC) $(CFLAGS) -std=gnu99 $(DEFINES) $(LDFLAGS) $(LDIMG) $(SRCS) $(DEBAYER) -o $@
sbig340_daemon : $(SRCS)
@echo -e "\t\tBuild daemon"
$(CC) -DDAEMON $(CFLAGS) -std=gnu99 $(DEFINES) $(LDFLAGS) $(SRCS) -o $@
sbig340_client : $(SRCS) $(DEBAYER)
@echo -e "\t\tBuild client"
$(CC) -DCLIENT $(CFLAGS) -std=gnu99 $(DEFINES) $(LDFLAGS) $(LDIMG) $(SRCS) $(DEBAYER) -o $@
clean:
@echo -e "\t\tCLEAN"
@rm -f $(OBJS) debayer.o
xclean: clean
@echo -e "\t\tRM binaries"
@rm -f sbig340_standalone sbig340_daemon sbig340_client
gentags:
CFLAGS="$(CFLAGS) $(DEFINES)" geany -g sbig340.c.tags *.[hc] *.cpp 2>/dev/null
.PHONY: gentags clean xclean