Usermode/utests - Fix DNS utest, update libc utests to new format (no more EXP files)
[tpg/acess2.git] / Usermode / Libraries / Makefile.tpl
index 8b27121..8706a0a 100644 (file)
@@ -24,6 +24,14 @@ LDFLAGS := $(LDFLAGS:--%=-Wl,--%)
 _LIBS := $(filter -l%,$(LDFLAGS))
 _LIBS := $(patsubst -l%,$(OUTPUTDIR)Libs/lib%.so,$(_LIBS))
 
+ifeq ($(ARCHDIR),native)
+ LIBS := $(patsubst -lc,-lc_acess,$(LIBS))
+ LIBS := $(patsubst -lc++,-lc++_acess,$(LIBS))
+ ifneq ($(BIN),libc_acess.so)
+  LIBS += -lc_acess
+ endif
+endif
+
 OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
 
 UTESTS := $(patsubst TEST_%.c,%,$(wildcard TEST_*.c))
@@ -35,7 +43,7 @@ else
 V := @
 endif
 
-.PHONY: all clean install postbuild
+.PHONY: all clean install postbuild utest-build utest-run generate_exp
 
 all: _libs $(_BIN) $(_XBIN)
 
@@ -47,6 +55,7 @@ HEADERS := $(patsubst include_exp/%,../../include/%,$(shell find include_exp/ -n
 _libs: $(HEADERS)
 
 ../../include/%: include_exp/%
+       @echo [LN] $@
        @mkdir -p $(dir $@)
        @ln -s $(shell pwd)/$< $@
 
@@ -54,18 +63,16 @@ _libs: $(HEADERS)
 
 utest: utest-build utest-run
 
-generate_exp: $(UTESTS:%=EXP_%.txt)
-       @echo > /dev/null
+utest-build: _ $(UTESTS:%=TEST_%)
 
-utest-build: $(UTESTS:%=TEST_%)
-       @echo > /dev/null
+utest-run: _ $(UTESTS:%=runtest-%)
 
-utest-run: $(UTESTS:%=runtest-%)
-       @echo > /dev/null
+_:
+       @true
 
-$(UTESTS:%=runtest-%): runtest-%: TEST_% EXP_%.txt
+$(UTESTS:%=runtest-%): runtest-%: TEST_%
        @echo --- [TEST] $*
-       @./TEST_$* | diff EXP_$*.txt -
+       @./TEST_$*
 
 clean:
        $(RM) $(_BIN) $(_XBIN) $(OBJ) $(_BIN).dsm $(DEPFILES) $(EXTRACLEAN)
@@ -128,7 +135,7 @@ $(OUTPUTDIR)Libs/%:
 obj-native/%.no: %.c
        @mkdir -p $(dir $@)
        @echo [CC Native] -o $@
-       @$(NCC) -g -c $< -o $@ -Wall -std=gnu99 -MD -MP -MF [email protected] '-D_SysDebug(f,v...)=fprintf(stderr,"DEBUG "f"\n",##v)' -include stdio.h
+       @$(NCC) -g -c $< -o $@ -Wall -std=gnu99 -MD -MP -MF [email protected] '-D_SysDebug(f,v...)=fprintf(stderr,"DEBUG "f"\n",##v)' -include stdio.h -I $(ACESSDIR)/Usermode/Libraries/_utest_include/
 
 TEST_%: obj-native/TEST_%.no obj-native/%.no
        @echo [CC Native] -o $@

UCC git Repository :: git.ucc.asn.au