1: #############################################################################
     2: #############################################################################
     3: #
     4: # Makefile for gzmcpc4nds
     5: #
     6: # Copyright 2008-2009 Douglas McClendon -- dmc AT viros DOT org
     7: #
     8: #############################################################################
     9: #############################################################################
    10: 
    11: # export all make variables by default 
    12: # (until I discover a con at least)
    13: export
    14: 
    15: ####################
    16: # Global Variables #
    17: ####################
    18: 
    19: # define c compiler, etc...
    20: CC = gcc
    21: CXX = g++
    22: OBJCOPY = objcopy
    23: 
    24: 
    25: # common includes and libdirs
    26: INCLUDES := 
    27: # protocol definition shared with client
    28: LIBDIRS :=
    29: 
    30: # initialize common_cflags
    31: COMMON_CFLAGS := -Wall
    32: 
    33: # add common cflags
    34: COMMON_CFLAGS += -g
    35: COMMON_CFLAGS += -O2
    36: 
    37: INCFLAGS := $(foreach dir,$(INCLUDES),-I$(dir)) 
    38: 
    39: CFLAGS := $(COMMON_CFLAGS)
    40: CFLAGS += $(INCFLAGS)
    41: 
    42: ###############
    43: # Build Rules #
    44: ###############
    45: 
    46: # Generic Rules
    47: # (note: unchanged from default - for override reference)
    48: %.o : %.c
    49: 	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    50: 
    51: 
    52: default: all
    53: 
    54: all: gzmcp-client-debug.x86 
    55: 
    56: gzmcp-client-debug.x86: client.c client.h gzmcp_protocol.h
    57: 	@echo BUILD: compiling Guitar-ZyX Master Control Program client code...
    58: 	$(CC) $(CFLAGS) $(CPPFLAGS) -lasound -o gzmcp-client-debug.x86 client.c
    59: 
    60: tidy:
    61: 	@echo removing transient files
    62: 	rm -f *~ *.o 
    63: 
    64: .PHONY: clean
    65: clean: tidy
    66: 	rm -f gzmcp-client-debug.x86 
    67: 
    68: