-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 690 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 690 Bytes
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
CXX = g++ -fPIC
NETLIBS= -lnsl
CC=gcc
all: git-commit myhttpd daytime-server use-dlopen hello.so
jj-mod.o: jj-mod.c
$(CC) -c jj-mod.c -fPIC
util.o: util.c
$(CC) -c util.c -fPIC
jj-mod.so: jj-mod.o util.o
ld -G -o jj-mod.so jj-mod.o util.o -fPIC
myhttpd : myhttpd.o
$(CXX) -o $@ $@.o $(NETLIBS) -lpthread -ldl
hello.so: hello.o
ld -G -o hello.so hello.o
%.o: %.cc
@echo 'Building $@ from $<'
$(CXX) -o $@ -c -I. $<
.PHONY: git-commit
git-commit:
git checkout
git add *.cc *.h Makefile >> .local.git.out || echo
git commit -a -m 'Commit' >> .local.git.out || echo
git push origin main
.PHONY: clean
clean:
rm -f *.o use-dlopen hello.so
rm -f *.o daytime-server myhttpd