1include ../Makefile.conf
2
3MODULES=Main.o
4
5ifeq ($(SPLATFORM),WINDOWS)
6OBJS=$(subst .o,.obj,$(MODULES))
7SLIBS=/libpath:../stoolkit stoolkit.lib
8SWINLIBS=/libpath:../swindow  swindow.lib
9SWIDGETLIBS=/libpath:../swidget swidget.lib
10MYLIBS=/link /subsystem:CONSOLE $(SWIDGETLIBS) $(SWINLIBS) $(SLIBS) $(SWINDOW_LIBS) $(ALL_LIBS)
11else
12OBJS=$(MODULES)
13SLIBS=-L../stoolkit -lstoolkit
14SWIDGETLIBS=-L../swidget -lswidget
15MYLIBS=$(SWIDGETLIBS) $(SWINLIBS) $(SLIBS) $(ALL_LIBS)
16
17ifeq ($(SWINDOWS),OSX)
18SWINLIBS=-L../swindow -lswindow -Wl,-framework,Cocoa
19else
20SWINLIBS=-L../swindow -lswindow
21endif
22
23endif
24
25.PHONY:all clean config
26
27all:  uniprint
28
29uniprint: $(OBJS)
30	$(LD) -o uniprint $(OBJS) $(MYLIBS)
31
32%.o:%.cpp
33	$(CXX) -c $(CPPFLAGS) $(subst .o,.cpp,$@)
34
35%.obj:%.cpp
36	$(CXX) -c $(CPPFLAGS) $(subst .obj,.cpp,$@)
37
38install:
39	rm -f $(DESTDIR)/$(bindir)/uniprint
40	$(INSTALL_PROGRAM) uniprint $(DESTDIR)/$(bindir)
41	$(INSTALL_DATA) uniprint.1 $(DESTDIR)/$(mandir)/man1
42
43clean:
44	rm -f *.o *.obj uniprint uniprint.exe core
45
46$(SUBDIRS_clean):
47	$(MAKE) -C $(patsubst %_clean,%,$@) clean
48
49depend:
50	$(CXX) -M  $(CPPFLAGS)  $(patsubst %.o,%.cpp,$(OBJS)) > .depend
51
52
53ifeq (.depend, $(wildcard .depend))
54include .depend
55endif
56