1 |
< |
# "Senior Level" Makefile :) |
1 |
> |
# Makefile for sysinfo programs |
2 |
|
|
3 |
– |
OBJECTS = load.o |
4 |
– |
|
3 |
|
CXXFLAGS += -g |
4 |
+ |
OBJECTS = sysinfo.o hostname.o load.o environment.o |
5 |
|
|
6 |
< |
%.d : %.cc |
8 |
< |
set -e; $(CXX) -M $(CPPFLAGS) $< \ |
9 |
< |
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ |
10 |
< |
[ -s $@ ] || rm -f $@ |
11 |
< |
|
12 |
< |
load : $(OBJECTS) |
6 |
> |
sysinfo: $(OBJECTS) |
7 |
|
$(LINK.cc) -o $@ $(OBJECTS) |
8 |
|
|
9 |
< |
include $(OBJECTS:%.o=%.d) |
9 |
> |
sysinfo.o: sysinfo.cc hostname.hh load.hh |
10 |
> |
hostname.o: hostname.cc hostname.hh |
11 |
> |
load.o: load.cc load.hh |
12 |
> |
environment.o: environment.cc environment.hh |
13 |
|
|
14 |
< |
clean : |
14 |
> |
clean: |
15 |
|
rm -f $(OBJECTS) |
16 |
< |
rm -f $(OBJECTS:%.o=%.d) |
20 |
< |
rm -f load |
21 |
< |
|
16 |
> |
rm -f sysinfo |