-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 851 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
PROGNAME=spassgen
VERSION=0.1
DISTNAME=$(PROGNAME)-$(VERSION)
CFLAGS=-std=c11 -Wall -Wextra -Wpedantic -Os -march=native
CC=gcc
LIBS=-lm
DEBUGFLAGS=-g -DDEBUG
NODEBUGFLAGS=-DNDEBUG
MAINDEPS=
PREFIX=/usr
ifndef DEBUG
DEBUG=$(NODEBUGFLAGS)
endif
all: $(PROGNAME)
%.o : %.c
$(CC) $(CFLAGS) $(DEBUG) -c $^
$(PROGNAME): main.c $(MAINDEPS)
$(CC) $(CFLAGS) $(DEBUG) -o $@ main.c $(MAINDEPS) $(LIBS)
debug:
export DEBUG="$(DEBUGFLAGS)" && $(MAKE)
install: $(PROGNAME)
install -sD $(PROGNAME) $(DESTDIR)/$(PREFIX)/bin/$(PROGNAME)
uninstall:
rm $(DESTDIR)/$(PREFIX)/bin/$(PROGNAME)
dist: $(wildcard *.c) $(wildcard *.h) Makefile PKGBUILD
mkdir $(DISTNAME)
cp $^ $(DISTNAME)
tar -czf $(DISTNAME).tar.gz $(DISTNAME)
updpkgsums
makepkg -sc
rm -rf $(DISTNAME)
clean:
rm -rf *.o $(PROGNAME) *.tar.gz *.pkg.tar.xz $(DISTNAME)/
distclean: clean