I got this:
Code:
default: force
cd ../ && make $(MAKEFILES)
%: default
force: ;
Running make without targets gives the expected result but when I try with targets (such as "make test") it gives me this:
Code:
make test (in directory: ~/mitsy/include/mcc/core)
make: *** No rule to make target 'test'. Stop.
Compilation failed.
Any ideas?
FYI the final makefile looks like this:
Code:
INC_PATHS=../include
IS_WINDOWS:=$(if $(Program Files),1,)
IS_WIN64:=$(if ${Program Files(x86)},1,)
IS_WIN32:=$(if $(IS_WIN64),,$(IS_WINDOWS))
EXE?=$(if $(IS_WINDOWS),exe,AppImage)
IFLAGS:=$(INC_PATHS:%=-I %)
CFLAGS:=-Wall $(IFLAGS)
mcc: mcc_core.so
test: mcc_core.so test.$(EXE)
mcc_core.so: mcc_get.c mcc_mem.c mcc_vint.c mcc_vflt.c
test.AppImage: test/unit_tests.o
mcc_vflt.c: mcc/core/vflt.h
mcc_vint.c: mcc/core/vint.h
mcc_get.c: mcc/core/get.h
mcc_mem.c: mcc/core/mem.h
mcc/core/vflt.h: mcc/core/vint.h
mcc/core/vint.h: mcc/core/get.h
mcc/core/get.h: mcc/core/mem.h
mcc/core/mem.h: mcc/malloc.h
mcc/malloc.h: mcc/vmalloc.h
mcc/vmalloc.h: mcc/inttypes.h
mcc/inttypes.h: mcc/stdint.h
mcc/stdint.h: mcc/limits.h
mcc/limits.h: mcc/core/sys.h
mcc/core/sys.h:
test/unit_tests.o: test/unit_tests.c
test/unit_tests.c: test/core/vint.c
%.o: %.c
clang $(CFLAGS) -o $@ $<
force: ;