48 lines
1.1 KiB
Makefile
48 lines
1.1 KiB
Makefile
|
SRC := lgdemo.c
|
||
|
TARGETS := lgdemo lgdemo-static
|
||
|
FILE_BIN := lgdemo lgdemo-static
|
||
|
FILE_LIB := lgdemo.dat
|
||
|
|
||
|
|
||
|
|
||
|
include ../Makefile.var
|
||
|
include ../Makefile.rule
|
||
|
|
||
|
|
||
|
|
||
|
DEP_STATIC += ../lib/liblog.a
|
||
|
DEP_DYNAMIC += ../lib/liblog.so
|
||
|
INCLUDE += -I . -I ../include
|
||
|
LIBDIR += -L . -L ../lib
|
||
|
LIB_STATIC += ../lib/liblog.a
|
||
|
LIB_DYNAMIC += -llog
|
||
|
CFLAGS += -rdynamic
|
||
|
|
||
|
ifdef _LIBVER_SUPPORT
|
||
|
DEP_STATIC += ../../libver/ver.h ../../libver/libver.a
|
||
|
DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so
|
||
|
INCLUDE += -I ../../libver/lib
|
||
|
LIBDIR += -L ../../libver/lib
|
||
|
|
||
|
ifeq ($(OSTYPE),linux-gnu)
|
||
|
LIB_STATIC += ../../libver/lib/libver.a
|
||
|
LIB_DYNAMIC += -lver
|
||
|
else
|
||
|
LIB_STATIC += ../../libver/lib/libver.a
|
||
|
LIB_DYNAMIC += -lver
|
||
|
endif
|
||
|
|
||
|
CFLAGS += -D_LIBVER_SUPPORT
|
||
|
endif
|
||
|
|
||
|
ND_CHECK_FLAGS = -DND_MODE=0
|
||
|
ND_NOCHECK_FLAGS = -DND_MODE=1
|
||
|
|
||
|
|
||
|
|
||
|
lgdemo: lgdemo.c $(DEP_DYNAMIC)
|
||
|
$(CC) -o $@ $(CFLAGS) $(ND_NOCHECK_FLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $<
|
||
|
|
||
|
lgdemo-static: lgdemo.c $(DEP_STATIC)
|
||
|
$(CC) -o $@ $(CFLAGS) $(ND_NOCHECK_FLAGS) $(INCLUDE) $< $(LIB_STATIC)
|