diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d41c588 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +SUBDIRS = example + +.PHONY: subdirs $(SUBDIRS) + +subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +CLEANDIRS = $(SUBDIRS:%=clean-%) + +clean: $(CLEANDIRS) +$(CLEANDIRS): + $(MAKE) -C $(@:clean-%=%) clean + +.PHONY: subdirs $(INSTALLDIRS) +.PHONY: clean diff --git a/example/DllLoader/Makefile b/example/DllLoader/Makefile index 55ff822..2a67dd2 100644 --- a/example/DllLoader/Makefile +++ b/example/DllLoader/Makefile @@ -10,6 +10,7 @@ CXX = g++ LINK = ld endif +RM = rm CFLAGS = -Wall -g LDFLAGS = @@ -23,3 +24,6 @@ DllLoader.exe: $(OBJ) %.o: %.cc $(CC) $(CFLAGS) -c $< + +clean: + $(RM) -rf $(OBJ) DllLoader.exe diff --git a/example/Makefile b/example/Makefile new file mode 100644 index 0000000..2852993 --- /dev/null +++ b/example/Makefile @@ -0,0 +1,17 @@ +SUBDIRS = DllLoader SampleDLL + +.PHONY: subdirs $(SUBDIRS) + +subdirs: $(SUBDIRS) + +$(SUBDIRS): + $(MAKE) -C $@ + +CLEANDIRS = $(SUBDIRS:%=clean-%) + +clean: $(CLEANDIRS) +$(CLEANDIRS): + $(MAKE) -C $(@:clean-%=%) clean + +.PHONY: subdirs $(INSTALLDIRS) +.PHONY: clean diff --git a/example/SampleDLL/Makefile b/example/SampleDLL/Makefile index cd58a20..14ab428 100644 --- a/example/SampleDLL/Makefile +++ b/example/SampleDLL/Makefile @@ -10,6 +10,7 @@ CXX = g++ LINK = ld endif +RM = rm CFLAGS = -Wall -g -DSAMPLEDLL_EXPORTS LDFLAGS = -shared @@ -20,3 +21,6 @@ SampleDLL.dll: $(OBJ) %.o: %.cpp $(CXX) $(CFLAGS) -c $< + +clean: + $(RM) -rf $(OBJ) SampleDLL.dll