Added OS detection into tests to add EXE extension to test executables for cleanup. (#46)
This commit is contained in:
+12
-6
@@ -1,7 +1,7 @@
|
||||
#Makefile to build CRC tests
|
||||
CC = gcc
|
||||
SRC_DIR = ../src
|
||||
INCLUDES = -I$(SRC_DIR) -I. -I../demo/object
|
||||
INCLUDES = -I$(SRC_DIR) -I. -I../demo/object
|
||||
DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_CRC
|
||||
|
||||
CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g
|
||||
@@ -11,20 +11,26 @@ SRCS = $(SRC_DIR)/bacnet/datalink/crc.c \
|
||||
|
||||
OBJS = ${SRCS:.c=.o}
|
||||
|
||||
TARGET = crc
|
||||
TARGET_NAME = crc
|
||||
ifeq ($(OS),Windows_NT)
|
||||
TARGET_EXT = .exe
|
||||
else
|
||||
TARGET_EXT =
|
||||
endif
|
||||
TARGET = $(TARGET_NAME)$(TARGET_EXT)
|
||||
|
||||
all: ${TARGET}
|
||||
|
||||
|
||||
${TARGET}: ${OBJS}
|
||||
${CC} -o $@ ${OBJS}
|
||||
${CC} -o $@ ${OBJS}
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $*.c -o $@
|
||||
|
||||
|
||||
depend:
|
||||
rm -f .depend
|
||||
${CC} -MM ${CFLAGS} *.c >> .depend
|
||||
|
||||
|
||||
clean:
|
||||
rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini
|
||||
|
||||
|
||||
Reference in New Issue
Block a user