aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 4f2f0c02028cce24c92551141a6a2c302947949b (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
.POSIX:

RM := /bin/rm
DESTDIR := /usr/local/bin

CFLAGS := -std=c99 -Wfloat-equal -Og
CFLAGS += -Wall -Werror -Wextra -Wpedantic
CFLAGS += -m64 -no-pie -pipe
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -D_XOPEN_SOURCE=500L -flto
CFLAGS += -march=native -mtune=generic

LDFLAGS := -static -Wl,--build-id=none
LDFLAGS += -ffunction-sections -fdata-sections
#LDFLAGS += -Wl,--strip-all
LDFLAGS += -Wl,--flto

.SUFFIXES: .c .o

g2x: $(FILES) *.o
	$(CC) $(LDFLAGS) *.o -o g2x

.c.o:
	$(CC) $(CFLAGS) -c *.c

clean:
	$(RM) ./*.o

install:
	install -s -m 0755 g2x $(DESTDIR)
	install -m 0755 c2x $(DESTDIR)

.PHONY: make clean install