-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.in
More file actions
44 lines (33 loc) · 1.14 KB
/
Makefile.in
File metadata and controls
44 lines (33 loc) · 1.14 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
.PHONY: prestart, clean
BINDIR = @bindir@
# `DEBUG=1 make` for debug assembly
# If you switch compilation type some symbols may still be in objects.
# Make don't fires some rules because of no changes in compile files.
# In this case linker stops assembly bacause he don't see symbols (from DEBUG assembly for example).
# So we need to clear objects (run `make clean` command) when compile mode is changed.
CC_OPTIONS = -Wall
PROG_NAME = autolight
BUILD_DIR = ./bin
LIB_DIR = ./lib
SO_LIBS = -ljpeg -lm -lxcb -lxcb-util -lxcb-randr
OBJECTS = $(BUILD_DIR)/$(PROG_NAME).o $(BUILD_DIR)/xws.o $(BUILD_DIR)/v4l2.o
ifdef DEBUG
CC_OPTIONS += -g -DDEBUG
endif
build: $(OBJECTS)
gcc $(CC_OPTIONS) $(OBJECTS) $(SO_LIBS) -o $(BUILD_DIR)/$(PROG_NAME)
$(BUILD_DIR)/$(PROG_NAME).o: $(PROG_NAME).c
mkdir -p bin
gcc $(CC_OPTIONS) -o $@ -c $^
$(BUILD_DIR)/xws.o: $(LIB_DIR)/xws.c
gcc $(CC_OPTIONS) -o $@ -c $^
$(BUILD_DIR)/v4l2.o: $(LIB_DIR)/v4l2.c
gcc $(CC_OPTIONS) -o $@ -c $^
ifndef DEBUG
install: build
install bin/autolight $(BINDIR)
uninstall: build
rm $(BINDIR)/autolight
endif
clean:
-rm $(BUILD_DIR)/*.o $(BUILD_DIR)/$(PROG_NAME) $(BUILD_DIR)/*.bmp *.bmp