summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: 05f2a226ed3ca670e34b1cf0777104e27a98824e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.POSIX:

all: bosix

CFLAGS=-Wall -Wextra -Wpedantic
LDFLAGS=
LIBS=-ll -ly

include .deps.mk
include .objs.mk

bosix: $(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)

deps:
	printf '.POSIX:\n\n' > .deps.mk
	grep include *.c | sed -e 's/#include//g;s/"//g;s/\.c:/.o:/g' >> .deps.mk
	printf '.POSIX:\n\nOBJS=' > .objs.mk
	for i in *.c; do printf '\\\n\t%s.o' $$(basename $$i .c); done >> .objs.mk
	printf '\n' >> .objs.mk

clean:
	rm -f bosix *.o