forked from Gibtnix/MSIKLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·50 lines (34 loc) · 1.13 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
#############################################################################
# Makefile for building MSI Keyboard Light Manager (MSIKLM)
#############################################################################
####### Compiler, tools and options
CC = gcc
FLAGS = -m64 -pipe -O3 -Wall -W -D_REENTRANT
LINK = gcc
LFLAGS = -m64 -Wl,-O3
LIBS = -lhidapi-libusb
DEL_FILE = rm -f
####### Files
SRCPATH = ./src/
HEADERS = $(SRCPATH)msiklm.h
SOURCES = $(SRCPATH)main.c $(SRCPATH)msiklm.c
OBJECTS = main.o msiklm.o
TARGET = msiklm
INSTALLPREFIX = /usr/local/bin
####### Build rules
.PHONY: clean delete install
all: Makefile $(TARGET)
$(TARGET): $(HEADERS) $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
clean:
-$(DEL_FILE) $(OBJECTS)
delete: clean
-$(DEL_FILE) $(TARGET)
install:
@mv -v $(TARGET) $(INSTALLPREFIX)/$(TARGET)
@chmod 755 $(INSTALLPREFIX)/$(TARGET)
####### Compile
main.o: $(SRCPATH)main.c
$(CC) -c $(FLAGS) -o main.o $(SRCPATH)main.c
msiklm.o: $(SRCPATH)msiklm.h $(SRCPATH)msiklm.c
$(CC) -c $(FLAGS) -o msiklm.o $(SRCPATH)msiklm.c