Skip to content

Commit

Permalink
utils/pdbt: FreeBSD fix, gcc is hardcoded, header is missing
Browse files Browse the repository at this point in the history
- use CC environment variable if set
- added missing sys/stat.h header
  • Loading branch information
Rick Barenthin committed Mar 14, 2017
1 parent b926e40 commit 32e1e50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions utils/pdbt/Makefile
@@ -1,3 +1,11 @@
#set some vars from the environment (and not make builtins)
CC := $(shell echo "$${CC}")

# find compiler name & version
ifeq ($(CC),)
CC=gcc
endif

.phony: all clean install

header=common.h carrier.h dt.h dtm.h pdb_server_backend.h log.h
Expand All @@ -10,13 +18,13 @@ extdep=Makefile
all: pdbt pdb_server

$(obj): %.o : %.c %.h $(header) $(extdep)
gcc $(cflags) -c $<
$(CC) $(cflags) -c $<

pdbt: pdbt.c $(obj) $(header) $(extdep)
gcc $(cflags) -o $@ $< $(obj)
$(CC) $(cflags) -o $@ $< $(obj)

pdb_server: pdb_server.c $(pdb_server_obj) $(header) $(extdep)
gcc $(cflags) -o $@ $< $(pdb_server_obj)
$(CC) $(cflags) -o $@ $< $(pdb_server_obj)

clean:
rm -f *~ *.o pdbt pdb_server
Expand Down
1 change: 1 addition & 0 deletions utils/pdbt/pdbt.c
Expand Up @@ -28,6 +28,7 @@
#include <poll.h>
#include <ctype.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
Expand Down

0 comments on commit 32e1e50

Please sign in to comment.