| 1 |
#set some vars from the environment (and not make builtins) |
| 2 |
CC := $(shell echo "$${CC}") |
| 3 |
|
| 4 |
# find compiler name & version |
| 5 |
ifeq ($(CC),) |
| 6 |
CC=gcc |
| 7 |
endif |
| 8 |
|
| 9 |
.phony: all clean install |
| 10 |
|
| 11 |
header=common.h carrier.h dt.h dtm.h pdb_server_backend.h log.h |
| 12 |
obj=dt.o dtm.o carrier.o pdb_server_backend.o log.o common.o |
| 13 |
pdb_server_obj=pdb_server_backend.o dtm.o log.o common.o |
| 14 |
cflags=-Wall -O2 -g |
| 15 |
# -march=x86-64 |
| 16 |
extdep=Makefile |
| 17 |
|
| 18 |
all: pdbt pdb_server |
| 19 |
|
| 20 |
$(obj): %.o : %.c %.h $(header) $(extdep) |
| 21 |
$(CC) $(cflags) -c $< |
| 22 |
|
| 23 |
pdbt: pdbt.c $(obj) $(header) $(extdep) |
| 24 |
$(CC) $(cflags) -o $@ $< $(obj) |
| 25 |
|
| 26 |
pdb_server: pdb_server.c $(pdb_server_obj) $(header) $(extdep) |
| 27 |
$(CC) $(cflags) -o $@ $< $(pdb_server_obj) |
| 28 |
|
| 29 |
clean: |
| 30 |
rm -f *~ *.o pdbt pdb_server |
| 31 |
|
| 32 |
install: |
| 33 |
cp pdbt $(DESTDIR)/usr/bin/ |
| 34 |
cp pdb_server $(DESTDIR)/usr/bin/ |
| 35 |
cp pdb_server.conf $(DESTDIR)/etc/ |