aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: e499fddad57b83c16e798f01643eee0ffafc3057 (plain)
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


CC=gcc
PROG=mesms
LIBS=-lcurses -lreadline
HEADERS=$(wildcard *.h)
FILES=readline.c wind.c contactList.c basic_curses.c contactWind.c sms.c messageWind.c readConfig.c
OBJ_FILES := $(FILES:.c=.o)
CFLAGS+=-std=gnu11


all: $(PROG)

debug: clean
debug: CFLAGS += -DDEBUG -g
debug: $(PROG)

$(PROG): main.c main.h $(OBJ_FILES)
	$(CC) $(CFLAGS) $(LIBS) -o $@ main.c $(OBJ_FILES)




%.o: %.c $(HEADERS)
	$(CC) $(CFLAGS) $(LIBS) -c -o $@ $<



.PHONY: clean mrproper

clean:
	rm -f $(OBJ_FILES)

mrproper: clean
	rm -f ./$(PROG)


install: $(PROG)
	cp $(PROG) /usr/bin/$(PROG)
	@echo 'Installation success'

uninstall: /usr/bin/$(PROG)
	rm -f /usr/bin/$(PROG)